啥也不说了,全是眼泪,弱弱的我遇到了下面的错误:
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException:
Duplicate files copied in APK META-INF/maven/com.squareup.okio/okio/pom.properties File1: E:\SearchPictureTool-master\SearchPictureTool-master\SearchPictureTool-master\app\libs
\com.umeng.message.lib_v2.5.0.jar File2: C:\Users\Administrator.gradle\caches\modules-2\files-2.1\com.squareup.okio\okio
\1.6.0\98476622f10715998eacf9240d6b479f12c66143\okio-1.6.0.jar
一脸蒙圈的开始解决,最后终于找出了解决办法,在gradle文件中添加:
packagingOptions { exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml' exclude 'META-INF/maven/com.squareup.okio/okio/pom.properties' } 原来的gradle: apply plugin: 'com.android.application'
android { compileSdkVersion 23 buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.administrator.searchpicturetool"
minSdkVersion 15
targetSdkVersion 23
versionCode 4
versionName "2.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:cardview-v7:23.1.1' compile 'com.jude:beam:2.6.5' compile 'com.jude:fitsystemwindowlayout:1.0.8' compile 'com.jakewharton:butterknife:6.1.0' compile 'com.jude:requestvolley:1.0.4' compile 'com.google.code.gson:gson:2.3.1' compile 'com.facebook.fresco:fresco:0.9.0+' compile 'com.pnikosis:materialish-progress:1.7' compile 'com.jude:utils:1.0.7' compile 'com.yalantis:contextmenu:1.0.4' compile 'com.readystatesoftware.systembartint:systembartint:1.0.3' compile 'com.google.code.gson:gson:2.4' compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3' compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3' compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta3' compile 'com.squareup.okhttp3:logging-interceptor:3.0.1' compile 'com.jude:rollviewpager:1.2.4' compile project(':library') compile project(':umengfamily') compile project(':umeng_sharelibrary') compile files('libs/com.umeng.message.lib_v2.5.0.jar') compile files('libs/BmobSDK_V3.4.5_1111.jar') compile files('libs/com.umeng.fb.5.4.0.jar') } 修改后的gradle: apply plugin: 'com.android.application'
android { compileSdkVersion 23 buildToolsVersion "23.0.1"
packagingOptions {
exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml'
exclude 'META-INF/maven/com.squareup.okio/okio/pom.properties'
}
defaultConfig {
applicationId "com.example.administrator.searchpicturetool"
minSdkVersion 15
targetSdkVersion 23
versionCode 4
versionName "2.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:cardview-v7:23.1.1' compile 'com.jude:beam:2.6.5' compile 'com.jude:fitsystemwindowlayout:1.0.8' compile 'com.jakewharton:butterknife:6.1.0' compile 'com.jude:requestvolley:1.0.4' compile 'com.google.code.gson:gson:2.3.1' compile 'com.facebook.fresco:fresco:0.9.0+' compile 'com.pnikosis:materialish-progress:1.7' compile 'com.jude:utils:1.0.7' compile 'com.yalantis:contextmenu:1.0.4' compile 'com.readystatesoftware.systembartint:systembartint:1.0.3' compile 'com.google.code.gson:gson:2.4' compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3' compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3' compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta3' compile 'com.squareup.okhttp3:logging-interceptor:3.0.1' compile 'com.jude:rollviewpager:1.2.4' compile project(':library') compile project(':umengfamily') compile project(':umeng_sharelibrary') compile files('libs/com.umeng.message.lib_v2.5.0.jar') compile files('libs/BmobSDK_V3.4.5_1111.jar') compile files('libs/com.umeng.fb.5.4.0.jar') } 搜噶,遇到的问题就解决了。