В модулях jetified-google-play-services.jar и jetified-play-services-base-17.0.0-runtime.jar обнаружены повторяющиеся классы. - PullRequest
0 голосов
/ 25 мая 2020

Я только что получал эту ошибку в Android Studio от одной секунды к другой после перезапуска Android Studio. Теперь я больше не могу строить свой проект. Я использую Ioni c 4 и Capacitor для своего проекта android.

Duplicate class com.google.android.gms.common.ErrorDialogFragment found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.GooglePlayServicesNotAvailableException found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.GooglePlayServicesRepairableException found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.GooglePlayServicesUtil found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.Scopes found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.SignInButton found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.SupportErrorDialogFragment found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.UserRecoverableException found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.annotation.KeepName found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.api.Api found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.Api$ApiOptions found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.Api$ApiOptions$HasOptions found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.Api$ApiOptions$NoOptions found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.Api$ApiOptions$NotRequiredOptions found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.Api$ApiOptions$Optional found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.Batch found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.Batch$Builder found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.BatchResult found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.BatchResultToken found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.CommonStatusCodes found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.api.GoogleApiClient found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.GoogleApiClient$Builder found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.PendingResult found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.api.Releasable found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.api.Result found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.api.ResultCallback found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.api.Scope found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.api.Status found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.common.data.DataBuffer found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.data.DataBufferUtils found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.data.DataHolder found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.data.Freezable found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.data.FreezableUtils found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.images.ImageManager found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.images.ImageManager$ImageReceiver found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.images.ImageManager$OnImageLoadedListener found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.images.WebImage found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-base-17.0.0-runtime.jar (com.google.android.gms:play-services-base:17.0.0)
    Duplicate class com.google.android.gms.common.internal.safeparcel.SafeParcelable found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.dynamic.LifecycleDelegate found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.location.ActivityRecognition found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.ActivityRecognitionApi found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.ActivityRecognitionClient found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.ActivityRecognitionResult found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.DetectedActivity found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.FusedLocationProviderApi found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.Geofence found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.Geofence$Builder found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.GeofenceStatusCodes found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.GeofencingApi found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.GeofencingEvent found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.LocationListener found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.LocationRequest found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.LocationServices found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.location.LocationStatusCodes found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-location-17.0.0-runtime.jar (com.google.android.gms:play-services-location:17.0.0)
    Duplicate class com.google.android.gms.security.ProviderInstaller found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
    Duplicate class com.google.android.gms.security.ProviderInstaller$ProviderInstallListener found in modules jetified-google-play-services.jar (google-play-services.jar) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)

Это мой файл build.gradle из плагинов ioni c cordova:

ext {
    cordovaAndroidVersion =  project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '7.0.0'
}

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 29
    defaultConfig {
        minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
        targetSdkVersion targetSdkVersion = project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 29
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    google()
    jcenter()
    mavenCentral()
    flatDir{
        dirs 'src/main/libs', 'libs'
    }
}

dependencies {
    implementation fileTree(dir: 'src/main/libs', include: ['*.jar'])
    implementation "org.apache.cordova:framework:$cordovaAndroidVersion"
    // SUB-PROJECT DEPENDENCIES START
    implementation "com.adgem:adgem-android:2.2.0"
    implementation "com.android.support:appcompat-v7:+"
    // SUB-PROJECT DEPENDENCIES END
}

// PLUGIN GRADLE EXTENSIONS START
apply from: "cordova.variables.gradle"
apply from: "../../node_modules/cordova-plugin-adgatemedia-ads/src/android/build.gradle"
apply from: "../../node_modules/cordova-plugin-offertoro-ads/src/android/build.gradle"
// PLUGIN GRADLE EXTENSIONS END

for (def func : cdvPluginPostBuildExtras) {
    func()
}

это мой android проект build.gradle:

// Файл сборки верхнего уровня, в который вы можете добавить параметры конфигурации, общие для всех подпроектов / модулей.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'
        classpath 'com.google.gms:google-services:4.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

apply from: "variables.gradle"

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Поскольку я не знаю, что происходит, я не знаю, что вам показать, поэтому, пожалуйста, спросите, можете ли вы нужно больше добавлю. Как-то я не могу найти решения для этой ошибки. Чтение Android Платформа не помогла.

1 Ответ

0 голосов
/ 25 мая 2020

Вы можете исправить это, добавив это в свой android блок в build.gradle:

configurations {
    implementation.exclude module:'proto-google-common-protos'
    implementation.exclude module:'protolite-well-known-types'
    implementation.exclude module:'protobuf-lite'
}
...