错误:com.duplicate entry: com/google/android/gms/internal/zzfj.class 意思是:重复条目错误:com/google/android/gms/internal/zzfj.class。

3

我正在尝试将一款旧的Android应用移植到新设备上。它在Android 5.x到7.1版本上运行良好,但在Android 4.x版本中无法运行。

当我尝试在Android 4.x设备或模拟器中安装它时,构建总是失败并显示相同的异常:

错误:重复条目:com/google/android/gms/internal/zzfj.class

apply plugin: 'com.android.application'

android {
  compileSdkVersion 25
  buildToolsVersion "25.0.2"
  defaultConfig {
    applicationId "sigmanews.sigmamentors"
    manifestPlaceholders = [onesignal_app_id: "c4321xxx-f85a-4ba1-983f-cc1399efb839",
      // Project number pulled from dashboard, local value is ignored.
      onesignal_google_project_number: "REMOTE"
    ]
    minSdkVersion 17
    targetSdkVersion 25
    versionCode 21
    versionName "23"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
  }
  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

repositories {
  mavenCentral()
  maven {
    url "https://jitpack.io"
  }
  maven {
    url "https://mint.splunk.com/gradle/"
  }
}

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support',
    module: 'support-annotations'
  })

  compile 'com.android.support:appcompat-v7:25.3.1'
  compile 'com.android.support.constraint:constraint-layout:1.0.2'

  compile "com.google.android.gms:play-services-ads:10.0.1"
  compile 'com.mcxiaoke.volley:library-aar:1.0.0'
  compile 'com.github.bumptech.glide:glide:3.7.0'
  compile 'com.github.tarek360:instacapture:2.0.0-kotlin-beta1'
  compile 'com.android.support:cardview-v7:25.1.0'
  compile 'org.apmem.tools:layouts:1.10@aar'
  compile 'com.github.TheBrownArrow:PermissionManager:1.0.0'
  compile 'com.google.code.gson:gson:2.7'
  compile 'com.squareup.picasso:picasso:2.5.2'
  compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.17'
  compile 'com.onesignal:OneSignal:[3.5.3,4.0.0)'
  compile 'com.splunk.mint:mint:5.0.0'
  compile 'com.facebook.android:facebook-android-sdk:4.6.0'
  compile 'com.google.android.gms:play-services-plus:11.0.4'
  compile 'com.google.android.gms:play-services-auth:10.0.1'
  compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
  compile 'com.github.robertsimoes:Shareable:0.1.0'

  testCompile 'junit:junit:4.12'
}
1个回答

1
使用相同版本的play-services依赖库。
compile 'com.google.android.gms:play-services-plus:11.0.4'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile "com.google.android.gms:play-services-ads:11.0.4'

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接