Gradle build error, Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug

来源:互联网 发布:淘宝权重值是什么意思 编辑:程序博客网 时间:2024/05/16 17:59

导入的项目很老,所以出现这个问题,最下面两种我弄完才看见,没有试过,不过 stack overflow 很多人说有用,你们可以尝试下

stack overflow上的解决办法

我当时 project.gradle 配置如下:

buildscript {    repositories {        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:2.2.3'        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}

1. 把 gradle 版本改到 1.2.3’ 就可以正常编译了

编译成功后,提示我版本过低不支持部署到 手机 上,擦,好吧

编译成功之后,注意,之后!我又把 gradle 版本改回了 2.2.3,成功部署到我的 小米5 s 上

2. Try adding multiDexEnabled true to your app build.gradle file

defaultConfig {    multiDexEnabled true}

3. added it into build.gradle

android {        packagingOptions {            exclude 'META-INF/DEPENDENCIES.txt'            exclude 'META-INF/NOTICE'            exclude 'META-INF/NOTICE.txt'            exclude 'META-INF/LICENSE'            exclude 'META-INF/LICENSE.txt'        }    }
0 0
原创粉丝点击