Android Studio Error:Execution failed 持续更新...
一. Android Studio Error:Execution failed for task app :transformClassesWithMultidexlistForRelease'.
首先我的Studio版本为3.0.1,然后出现的问题就是,直接build没有问题,但是打签名包时就出现了
Error:Execution failed for task ':skymonkey.jkgj.com:transformClassesWithMultidexlistForRelease'.
> java.lang.UnsupportedOperationException (no error message) 这个错误,然后 百度 谷歌一番,发现有好几个说道是 依赖的 moudle中的 jar包冲突,然后找了一遍 果真如此,统一了下 依赖的jar包版本 就可以了。
一般出现这种问题,都是项目中依赖的moudle中的 jar包 跟 自己项目中的冲突了,还可以把 moudle 中的
// compile fileTree(include: ['*.jar'], dir: 'libs')
provided fileTree(include: ['*.jar'], dir: 'libs')
遇到这样的问题:
1. 先看一下是不是项目中依赖的其它moudle的 jar包跟自己项目的版本冲突;
2. 然后再看看是不是有加 mutiDexEnabled true
3. 其它情况就 google吧
(2) Error:Execution failed for task ':app:transformClassesWithMultidexlistForRelease'.
> java.lang.UnsupportedOperationException (no error message)
产生这个问题的原因有可能是因为电脑机身的内存不足引发的问题,我在电脑上双开Studio, 然后电脑死机了,全部退出再从新进来,自动就好了;
二:Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProc
在AndroidStudio更新到3.0之后发现上面的配置不能用了,这里记录下解决方法
- 首先把项目下的build.gradle中的classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’删掉
- 把module下面的build.gradle最上面引入的插件删掉,不管是下面这两个中的哪一个,都删掉
- apply plugin: ‘com.neenbedankt.android-apt’
- apply plugin: ‘android-apt
在module下的build.gradle中的依赖修改为
// butterknife 组件注入implementation 'com.jakewharton:butterknife:8.6.0'annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
经过这三步就可以了
三. More than one file was found with OS independent path 'META-INF/rxjava.properties
添加需要的类库
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:okhttp:3.1.2'
compile 'com.squareup.okio:okio:1.7.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
在retrofit结合rxjava2的过程中,遇到了一个问题,
特记录一下:
More than one file was found with OS independent path 'META-INF/rxjava.properties
解决方式如下:
在app下的build.gradle里面的defaultConfig里面添加:
defaultConfig {
packagingOptions {
exclude 'META-INF/rxjava.properties' 或者 exclude 'META-INF/*'
}
}
四 : Error:The versions of the Android Gradle plugin and Gradle are not compatibl
当出现 Android Gradle plugin 跟 Gradle 不匹配的时候 ,只需要修改任意其中之一便可使其互相匹配; 那在哪里查看Android Gradle plugin 的版本呢? 在项目的 buildgradle 中 ,比如:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
Gradle 的版本查看在项目gradle文件中的gradlewrapper.properties 中 :比如
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
但愿能帮助到一些小伙伴们,我一直认为,在技术的道路上走的慢一点可以,但是千万别原地踏步.......
更多相关文章
- Android移动开发之【Android实战项目】渐变的TextView小漂亮代码
- 修改 android版本 签名问题
- 修改android版本号
- SQlite与android 的数据交互 (android 项目心得三)
- 问题:在运行android的项目时出现的异常
- undefined reference to '__android_log_print'(android studio1
- 在低版本Android上使用Material Design——AppCompat v21
- Android项目中如果json字符串中key-value顺序很重要,不要使用Andr