2 woyaoxianzaixiazai woyaoxianzaixiazai 于 2017.01.17 13:56 提问

android studio 异常求解

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.xml
File1: /Users/yunhwa/Documents/androidstudio/cfbchina/app/libs/okio-1.6.0.jar
File2: /Users/yunhwa/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.6.0/98476622f10715998eacf9240d6b479f12c66143/okio-1.6.0.jar
File3: /Users/yunhwa/Documents/androidstudio/cfbchina/app/build/intermediates/exploded-aar/cfbchina/PushSDK/unspecified/jars/classes.jar
File4: /Users/yunhwa/Documents/androidstudio/cfbchina/app/build/intermediates/exploded-aar/cfbchina/meiqiaSdk/unspecified/jars/classes.jar

2个回答

woyaoxianzaixiazai
woyaoxianzaixiazai   2017.01.17 14:04
woyaoxianzaixiazai
woyaoxianzaixiazai   2017.01.17 14:05

packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml'
exclude 'META-INF/maven/com.squareup.wire/wire-runtime/pom.properties'
}

    就是说,'META-INF/maven/com.squareup.wire/wire-runtime/pom.properties'导致的报错,就将'META-INF/maven/com.squareup.wire/wire-runtime/pom.properties'放到packagingOptions里exclude掉
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!