我正在构建由robotemplates提供的WebView原生应用。当我尝试构建APK时,我遇到了这个构建失败消息:
错误:任务执行失败':mobile:transformClassesWithJarMergingForDebug'。
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / android / gms / internal / zzfj.class
如果有人有复制品的解决方案,请帮忙。
这是我的build.gradle,非常乐意在需要时提供其他信息:
apply plugin: "com.android.application"
repositories {
maven { url 'https://maven.google.com' }
}
dependencies
{
compile "com.android.support:support-compat:25.1.1"
compile "com.android.support:support-core-utils:25.1.1"
compile "com.android.support:support-core-ui:25.1.1"
compile "com.android.support:support-fragment:25.1.1"
compile "com.android.support:appcompat-v7:25.1.1"
compile "com.android.support:design:25.1.1"
compile "com.google.android.gms:play-services-base:10.0.1"
compile "com.google.android.gms:play-services-analytics:10.0.1"
compile "com.google.android.gms:play-services-ads:10.0.1"
compile "com.google.android.gms:play-services-gcm:10.0.1"
compile "com.google.android.gms:play-services-location:10.0.1"
compile "com.onesignal:OneSignal:3.4.3@aar"
compile (name:"config", ext:"aar")
compile fileTree(dir: "libs", include: ["*.jar"])
compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
compile 'com.android.support:multidex:1.0.1'
}
...
apply plugin: 'com.google.gms.google-services'
这是我的另一个build.gradle:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}
(我是一个新手,请耐心等待我,因为我发现了多个错误)
答案 0 :(得分:0)
您必须编译两个OneSignal库
compile "com.onesignal:OneSignal:3.4.3@aar"
compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]’
尝试删除一个。