gpt4 book ai didi

android - 迁移到 Android Studio 后在运行时崩溃 (NoSuchMethodError)

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:08:10 25 4
gpt4 key购买 nike

我迁移到 Android studio,在我尝试运行该应用程序之前一切似乎都正常。它卡在 Launcher Activity 中然后崩溃,正在打印:

E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoSuchMethodError: No direct method <init>(ILjava/lang/String;)V in class Lcom/google/android/gms/common/api/Status; or its super classes (declaration of 'com.google.android.gms.common.api.Status' appears in /data/data/com.MY PACKAGE/files/instant-run/dex/slice-google-play-........b-classes.dex)
at com.google.android.gms.measurement.zza.<init>(Unknown Source)
at com.google.android.gms.measurement.zza.zzaR(Unknown Source)
at com.google.android.gms.measurement.internal.zzn.zziJ(Unknown Source)
at com.google.android.gms.measurement.internal.zzz.zza(Unknown Source)
at com.google.android.gms.measurement.internal.zzw.<init>(Unknown Source)
at com.google.android.gms.measurement.internal.zzaa.zzDj(Unknown Source)
at com.google.android.gms.measurement.internal.zzw.zzaT(Unknown Source)
at com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1759)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1728)
at android.app.ActivityThread.installProvider(ActivityThread.java:5534)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5105)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5045)
at android.app.ActivityThread.access$1600(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1459)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:168)
at android.app.ActivityThread.main(ActivityThread.java:5845)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)

最佳答案

对我来说,问题在于我的不同播放服务依赖项的版本不同,例如

dependencies {
compile 'com.google.android.gms:play-services-gcm:8.4.0' /different version
compile 'com.google.android.gms:play-services-maps:9.0.2'
compile 'com.google.android.gms:play-services-location:9.0.2'
}

应该改为

dependencies {
compile 'com.google.android.gms:play-services-gcm:9.0.2'
compile 'com.google.android.gms:play-services-maps:9.0.2'
compile 'com.google.android.gms:play-services-location:9.0.2'
}

我希望它对您或遇到相同问题的人有用。

关于android - 迁移到 Android Studio 后在运行时崩溃 (NoSuchMethodError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36692036/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com