Android 在设备上启动应用程序时出错
我在尝试运行应用程序时遇到此错误:Android 在设备上启动应用程序时出错,android,android-gradle-plugin,Android,Android Gradle Plugin,我在尝试运行应用程序时遇到此错误: Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/print/PrintHelper$PrintH
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException:
duplicate entry: android/support/v4/print/PrintHelper$PrintHelperStubImpl.class
清单包含以下部分:
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="19"
tools:ignore="OldTargetApi"
tools:overrideLibrary="android.support.test.espresso,
android.support.v7.appcompat,
android.support.mediacompat,
android.support.v4,
android.support.fragment,
android.support.coreui,
android.support.coreutils,
android.support.graphics.drawable,
android.support.compat">
</uses-sdk>
你知道我需要做什么吗
我是Android开发新手,所以请假设我什么都不知道…我曾经遇到过同样的问题,就像appcompat-v7包含support-v4一样,所以它创建了重复的条目 我通过排除v4支持库解决了以下问题:
compile ('com.android.support:appcompat-v7:26.+') {
exclude module: 'support-v4'
}
共享您的
Build.gradle
您多次构建同一个库…我从“重复条目”一词中收集到了这一点。。。我需要了解的是为什么/在哪里,以及更重要的是如何修复它…这起到了作用-它删除了错误,但将其替换为:错误:任务执行失败“:app:transformClassesWithJarMergingForDebug”。>com.android.build.api.transform.TransformException:java.util.zip.zipeException:duplicate entry:android/support/v7/widget/SearchView$10.classupdate-appcompat至'com.android.support:appcompat-v7:26.+'
compile ('com.android.support:appcompat-v7:26.+') {
exclude module: 'support-v4'
}