重新启动Android Studio之后,我刚刚在Android Studio中从一秒钟到另一个出现了此错误。现在我不能建立我的项目了。我在我的Android项目中使用Ionic 4和Capacitor。
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)
这是我的离子cordova插件的build.gradle文件:
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平台无济于事。
答案 0 :(得分:0)
您可以通过将其添加到android
中的build.gradle
块中来解决此问题:
configurations {
implementation.exclude module:'proto-google-common-protos'
implementation.exclude module:'protolite-well-known-types'
implementation.exclude module:'protobuf-lite'
}