我已将广告更新为: com.google.android.gms:play-services-ads:18.0.0 并导致用户崩溃。
Stack trace:
java.lang.RuntimeException: Unable to instantiate receiver com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" on path: DexPathList[[zip file "/data/app/base.apk"],nativeLibraryDirectories=[/data/app/lib/arm64, /vendor/lib64, /system/lib64]]
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2884)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1565)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" on path: DexPathList[[zip file "/data/app/base.apk"],nativeLibraryDirectories=[/data/app/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2879)
... 8 more
Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 10 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
任何一个都一样吗? 编辑:我已经启用了multidex,但是我降级到17.2.1,现在看来还可以。但是18.0.0无法正常工作
答案 0 :(得分:0)
昨天我遇到了同样的问题,我疯狂地寻找解决方案。对我来说,它可以将游戏服务的等级从18.0.0降级到17.2.1。
该库似乎是一个错误。当用户下载应用程序时发生了我的错误,此错误在一开始崩溃,但是如果您再次进入,它会很好地工作。
答案 1 :(得分:0)
更改Google日志:
为避免在从Play商店安装应用后首次启动时发生崩溃,此版本要求发行商在其build.gradle中声明其他依赖项:
com.google.android.gms:play-services-measurement:17.0.0
com.google.android.gms:play-services-measurement-sdk:17.0.0
答案 2 :(得分:0)
此问题已在18.1.0中解决。请参阅发行说明以获取更多信息:https://developers.google.com/admob/android/rel-notes
答案 3 :(得分:-1)
一起使用:
implementation 'com.google.android.gms:play-services-measurement:17.0.0'
implementation 'com.google.android.gms:play-services-ads:18.0.0'