报错1:
cvc-complex-type.2.4.a: 发现了以元素 'base-extension' 开头的无效内容。应以 '{layoutlib}' 之一开头
解决办法:gradle版本比较低,升级gradle即可解决。
报错2:
Kotlin could not find the required JDK tools in the Java installation '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home' used by Gradle. Make sure Gradle is running on a JDK, not JRE.
原因:此报错是找不到JDK tools,很大原因是目录配置错误导致的。
解决办法:给Java设置环境变量,将Java环境切换到自己安装的Java SDK上,可以参考:complieKotlin:Kotlin could not find the required JDK_JFengYuLu的博客-CSDN博客
报错3:Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: The currently selected variant "debug" uses split APKs, but none of the 1 split apks are compatible with the current device with ABIs "x86, armeabi-v7a, armeabi".
原因:下载的是x86类型的模拟器。
解决办法 :在build.gradle文件中,加上 x86。
报错4:Error while waiting for device: The emulator process for AVD Pixel_2_API_33 has terminated.
解决办法:我这里发现的问题是gradle的classpath配置错了,将build.gradle文件中dependencies里边gradle的classpath更改成正确的就解决了。
报错5:Caused by: com.android.tools.r8.CompilationFailedException: Compilation fail:
解决办法:清除缓存,具体可参考:Caused by: com.android.tools.r8.CompilationFailedException: Compilation fail: 异常处理_碧水逍遥的博客-CSDN博客_com.android.tools.r8