错误1:Manifest merger failed(清单合并失败) 错误信息:Error: Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.3.1] AndroidManifest.xml:22:18-91 is also present at [androidx.appcompat:appcompat:1.4.0] AndroidManifest.xml:22:18-86 value=(androidx.appcompat.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to
element at AndroidManifest.xml:9:5-37:19 to override.
解决方法:
在app模块的AndroidManifest.xml文件中的
...
错误2:Cannot resolve symbol 'R'(无法解析符号'R') 错误信息:Error: cannot find symbol class R
解决方法:
import android.R;
应该修改为import com.example.yourpackage.R;
。