本文介紹了如何解析在模塊jetified-play-services-base-11.0.1-runtime.jar";中找到的重復(fù)類com.google.android.gms.common.api.zzb(&Q;)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!
問(wèn)題描述
我是Android Studio開發(fā)方面的新手。我的項(xiàng)目中出現(xiàn)此錯(cuò)誤。
在模塊jetified-play-services-base-11.0.1-runtime.jar
中找到重復(fù)的類com.google.android.gms.common.api.zzb
以下是我的App Gradle依賴項(xiàng)代碼(build.gradle(Module:App))
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.gms:play-services-ads:18.3.0'
implementation 'com.google.android.gms:play-services:11.0.1'
}
以下是完整錯(cuò)誤:
Cause 1: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Duplicate class com.google.android.gms.common.api.zza found in modules jetified-play-services-base-11.0.1-runtime.jar (com.google.android.gms:play-services-base:11.0.1) 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.zzb found in modules jetified-play-services-base-11.0.1-runtime.jar (com.google.android.gms:play-services-base:11.0.1) 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.internal.zzb found in modules jetified-play-services-base-11.0.1-runtime.jar (com.google.android.gms:play-services-base:11.0.1) 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.internal.zzq found in modules jetified-play-services-base-11.0.1-runtime.jar (com.google.android.gms:play-services-base:11.0.1) 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.internal.zzr found in modules jetified-play-services-base-11.0.1-runtime.jar (com.google.android.gms:play-services-base:11.0.1) 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.internal.zzs found in modules jetified-play-services-base-11.0.1-runtime.jar (com.google.android.gms:play-services-base:11.0.1) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
我在我的項(xiàng)目中使用FusedLocation Service和Google Adds(Admob)。
import com.google.android.gms.common.api.GoogleApi;
import com.google.android.gms.location.FusedLocationProviderClient;
import android.location.Location;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds;
public class MainActivity extends AppCompatActivity
{
private AdView adView;
private InterstitialAd interstitialAd;
FusedLocationProviderClient client;
...
推薦答案
刪除此行:
implementation 'com.google.android.gms:play-services:11.0.1'
play-services-ads:18.3.0
將引入較新的版本,不需要對(duì)其進(jìn)行刪節(jié)。
這篇關(guān)于如何解析在模塊jetified-play-services-base-11.0.1-runtime.jar";中找到的重復(fù)類com.google.android.gms.common.api.zzb(&Q;)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,