当前位置: 首页 > 知识库问答 >
问题:

当我尝试运行我的android应用程序[重复]时,会出现此错误

林鹏鹍
2023-03-14
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.okhttp/okhttp/pom.xml File1: /home/sks/MyApplication/app/libs/okhttp-2.7.2.jar File2: /home/sks/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp/okhttp/2.7.2/20f6463eb19ac61960c5d91a094c2f4f0727dc2e/okhttp-2.7.2.jar

共有1个答案

融烨磊
2023-03-14

我认为问题是在你的gradle文件。你把okhttp放在libs文件夹里,你编译了两次。

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.okhttp'
 类似资料: