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个回答

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
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问