Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
来源:互联网 发布:南城整形医院知美 编辑:程序博客网 时间:2024/06/06 01:12
异常描述
Android Studio 编译运行的时候,出现以下错误:
Error:Executionfailedfortask’:app:transformResourcesWithMergeJavaResForDebug’.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.propertiesFile1:C:\Users\10648.gradle\caches\modules-2\files-2.1\io.reactivex.rxjava2\rxjava\2.0.0\5151c737c01616c372c3d00ab145868ede10e826\rxjava-2.0.0.jar
File2:C:\Users\10648.gradle\caches\modules-2\files-2.1\io.reactivex\rxjava\1.1.6\2586312cd2b8a511e4c6236736f5a039fc0f2273\rxjava-1.1.6.jar
问题分析
这个问题,google搜索一下,就会发现:
2.x: Duplicated file rxjava.properties #4445
截图:
解决
在你的 app/build.gradle
添加如下代码:
android { ... packagingOptions { exclude 'META-INF/rxjava.properties' }}
如果你还是不知道添加到什么地方,请继续往下看:
修改前 :
apply plugin: 'com.android.application'android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.kite.cloudlearn" minSdkVersion 19 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } // dataBinding 加入 dataBinding { enabled = true }}dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:design:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' compile 'com.github.bumptech.glide:glide:3.8.0' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.okhttp3:logging-interceptor:3.8.0' compile 'com.squareup.retrofit2:converter-gson:2.3.0' compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' compile 'io.reactivex:rxandroid:1.2.1'}
修改后:
apply plugin: 'com.android.application'android { compileSdkVersion 25 buildToolsVersion "25.0.2" packagingOptions { exclude 'META-INF/rxjava.properties' } defaultConfig { applicationId "com.kite.cloudlearn" minSdkVersion 19 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } // dataBinding 加入 dataBinding { enabled = true }}dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:design:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' compile 'com.github.bumptech.glide:glide:3.8.0' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.okhttp3:logging-interceptor:3.8.0' compile 'com.squareup.retrofit2:converter-gson:2.3.0' compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' compile 'io.reactivex:rxandroid:1.2.1'}
后续
如果你看了这篇文章,还是没有解决您的问题,那么烦请您联系我,我一定会帮到底!
- Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
- 解决 Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
- Android--Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
- 解决:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
- Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- 解决:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- 解决:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- >问题:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- org.jivesoftware.smack_2.2.1的api
- 收藏:优秀的个人博客
- Java萌新的排序算法学习(初级篇)
- H264参数结构一:元素的分层结构
- AbstractReferenceCountedByteBuf源码分析
- Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
- delphi7 FormatFloat 四舍五入
- ObjectARX编程(八) --------有名对象字典、用户字典和字典中的对象
- Java中Volatile关键字详解
- 求二叉树的所有结点之和,Python实现
- 欢迎使用CSDN-markdown编辑器
- java实现全排列
- 最简单的php操作MySQL数据库
- H264参数结构三:序列参数集层(SPS) & 图像参数集语义