- Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
永久禁用,在AS中D:\AndroidStudio\plugins\android\lib\templates\gradle-projects\NewAndroidProject\root 目录中找gradle.properties.ftl(后缀是ftl,不是properties)
打开此文件
添加一句 :android.enableAapt2=false,再次创建project时,错误即会消失
参考:https://blog.csdn.net/moqianmoqian/article/details/79598640
2.卡在Building gradle project info或refreshing gradle project
方法1:手动下载gradle压缩包,下载完成后,复制到C:\Users\用户名 .gradle\wrapper\dists\gradle-x.xx-all\xxxxxxxxxxxx
https://developer.android.com/studio/releases/gradle-plugin#updating-gradle(VPN)
方法2:使用AS自带的Gradle,在Settings中打开Gradle,选择Use local gradle distribution,然后选择Gradle 的目录即可,这样就不会根据项目中\gradle\wrapper\gradle-wrapper.properties 文件下载指定版本的gradle,而是使用指定的gradle
参考:https://blog.csdn.net/xx326664162/article/details/52002616
3.More than one file was found with OS independent path ‘META-INF/proguard/androidx-annotations.pro’
在报错的module下的builde.gradle文件中加入如下配置项:
android{
//处理所有报META-INF/*‘的错误
packagingOptions {
exclude ‘META-INF/proguard/androidx-annotations.pro’
}
}
packagingOptions:指定选项和规则,这些选项和规则确定将android插件包放入您的APK
参考:https://blog.csdn.net/yinxing2008/article/details/84817567
https://blog.csdn.net/hzw2017/article/details/80522146
4.Project with path ‘XXXX’ could not be found in project ‘:app’
setttings.gradle增加include
例如:include ‘:app’, ‘:Moudle1’,’:Moudel2’
5:Unable to resolve dependency for ‘:app@debug/compileClasspath’
引入了讯飞的库com.iflytek:libMsc:latest.release,作为Module项目,报依赖错,
把讯飞相关的
allprojects {
repositories {
// Msc.jar线上maven地址
maven {
url ‘http://libmsc.xfyun.cn/repository/maven-releases/’
}
jcenter()
mavenCentral()
}
}
repositories中的引用移入Project中的build.gradle的allprojects 的repositories中,ok
参考:https://blog.csdn.net/magicbaby810/article/details/79848425
6: Manifest merger failed with multiple errors, see logs
Manifest 混合失败,Terminal 窗口,项目执行 gradlew processDebugManifest --stacktrace
查看Error信息