[英]Didn't find class “com.google.android.gms.common.internal.zzaa”
i am unable to resolve this error我无法解决此错误
Didn't find class "com.google.android.gms.common.internal.zzaa" on path: DexPathList[[zip file "/data/app/com.birthday.photoframe.birthday_frames.birthday_cake-1/base.apk"],nativeLibraryDirectories=[/data/app/com.birthday.photoframe.birthday_frames.birthday_cake-1/lib/arm64, /system/lib64, /vendor/l在路径上没有找到类“com.google.android.gms.common.internal.zzaa”:DexPathList[[zip 文件“/data/app/com.birthday.photoframe.birthday_frames.birthday_cake-1/base.apk” ],nativeLibraryDirectories=[/data/app/com.birthday.photoframe.birthday_frames.birthday_cake-1/lib/arm64, /system/lib64, /vendor/l
here is my build.gradle file这是我的 build.gradle 文件
android {
compileSdkVersion 30
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.birthday.photoframe.birthday_frames.birthday_cake"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true //addded
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-
optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
} }
dependencies {
implementation 'com.android.support:multidex:2.0.0'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'com.google.android.material:material:1.2.1'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.google.android.gms:play-services-ads:19.3.0'
implementation 'com.google.android.gms:play-services-analytics:17.0.0'
implementation 'com.google.android.gms:play-services-appindexing:9.8.0'
}
Try adding this dependency to your gradle file:尝试将此依赖项添加到您的 gradle 文件中:
implementation 'com.android.support:multidex:1.0.3'
Also you should use the same versions for the support and play services libraries.此外,您应该为支持和播放服务库使用相同的版本。 And you should avoid using "+" for latest version.
并且您应该避免在最新版本中使用“+”。
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
EDIT: You may also add this part to your app level gradle file and try again.编辑:您也可以将此部分添加到您的应用程序级 gradle 文件中,然后重试。 I did not see anyone tried this but it may work.
我没有看到有人尝试过这个,但它可能有效。
allprojects {
repositories {
//...
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "12.0.1"
}
}
}
}
}
2ND UPDATE: Just seen this, the dependency below, covers all the others, then it may cause a duplication issue.第二次更新:刚刚看到这个,下面的依赖项涵盖了所有其他的,那么它可能会导致重复问题。 Remove the other dependencies and leave this one:
删除其他依赖项并保留这个:
implementation 'com.google.android.gms:play-services:12.0.1'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.