gpt4 book ai didi

android - com.google.android.gms.internal.firebase-perf.zzq.zzb(boolean)' 在空对象引用上

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

环境

  • Android 设备:小米 5\小米 6
  • Android 操作系统版本:8.0.0
  • Google Play Services 版本:没有 google 服务
  • Firebase/Play 服务 SDK 版本:com.google.firebase:firebase-plugins:1.1.0com.google.firebase:firebase-perf:15.1.0
  • TargetSdkVersion : 26

问题

java.lang.NullPointerException

Attempt to invoke virtual method 'void com.google.android.gms.internal.firebase-perf.zzq.zzb(boolean)' on a null object reference
com.google.android.gms.internal.firebase-perf.zzg.zzc(Unknown Source:2)
com.google.android.gms.internal.firebase-perf.zzk.run(Unknown Source:4)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
java.lang.Thread.run(Thread.java:764)

LogCat

FirebaseApp: Firebase API initialization failure.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(Unknown Source:72)
at com.google.firebase.FirebaseApp.zzc(Unknown Source:49)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source:119)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source:2)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source:28)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source:4)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1927)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1902)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source:23)
at android.app.ActivityThread.installProvider(ActivityThread.java:6425)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5939)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5851)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1689)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6683)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
Caused by: java.lang.SecurityException: Failed to find provider com.google.android.gms.phenotype for user 0; expected to find a valid ContentProvider for this authority
at android.os.Parcel.readException(Parcel.java:1942)
at android.os.Parcel.readException(Parcel.java:1888)
at android.content.IContentService$Stub$Proxy.registerContentObserver(IContentService.java:768)
at android.content.ContentResolver.registerContentObserver(ContentResolver.java:1940)
at android.content.ContentResolver.registerContentObserver(ContentResolver.java:1929)
at com.google.android.gms.internal.measurement.zzwp.zza(Unknown Source:32)
at com.google.android.gms.internal.measurement.zzws.zzry(Unknown Source:33)
at com.google.android.gms.internal.measurement.zzws.get(Unknown Source:14)
at com.google.android.gms.internal.measurement.zzex.get(Unknown Source:2)
at com.google.android.gms.internal.measurement.zzfg.zziu(Unknown Source:7)
at com.google.android.gms.internal.measurement.zzfg.isLoggable(Unknown Source:0)
at com.google.android.gms.internal.measurement.zzfg.zza(Unknown Source:3)
at com.google.android.gms.internal.measurement.zzfi.log(Unknown Source:12)
at com.google.android.gms.internal.measurement.zzgl.<init>(Unknown Source:226)
at com.google.android.gms.internal.measurement.zzgl.zzg(Unknown Source:28)
at com.google.android.gms.measurement.AppMeasurement.getInstance(Unknown Source:0)
at java.lang.reflect.Method.invoke(Native Method) 
at com.google.firebase.FirebaseApp.zza(Unknown Source:72) 
at com.google.firebase.FirebaseApp.zzc(Unknown Source:49) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source:119) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source:2) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source:28) 
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source:4) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1927) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1902) 
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source:23) 
at android.app.ActivityThread.installProvider(ActivityThread.java:6425) 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5939) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5851) 
at android.app.ActivityThread.-wrap1(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1689) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6683) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 



java.lang.SecurityException: Failed to find provider com.google.android.gsf.gservices for user 0; expected to find a valid ContentProvider for this authority
at android.os.Parcel.readException(Parcel.java:1942)
at android.os.Parcel.readException(Parcel.java:1888)
at android.content.IContentService$Stub$Proxy.registerContentObserver(IContentService.java:768)
at android.content.ContentResolver.registerContentObserver(ContentResolver.java:1940)
at android.content.ContentResolver.registerContentObserver(ContentResolver.java:1929)
at com.google.android.gms.internal.firebase-perf.zza.zza(Unknown Source:38)
at com.google.android.gms.internal.firebase-perf.zzq.<init>(Unknown Source:145)
at com.google.android.gms.internal.firebase-perf.zzg.zzp(Unknown Source:127)
at com.google.android.gms.internal.firebase-perf.zzg.zzb(Unknown Source:0)
at com.google.android.gms.internal.firebase-perf.zzh.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)


java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.internal.firebase-perf.zzq.zzb(boolean)' on a null object reference
at com.google.android.gms.internal.firebase-perf.zzg.zzc(Unknown Source:2)
at com.google.android.gms.internal.firebase-perf.zzk.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)

似乎是 SecurityException 导致了 Firebase API 初始化失败,然后出现了一些 NullPointerExceptions。

我试过降级性能工具,没用。然后我将 TargetSdkVersion 从 26 设置为 23,问题消失了。

最佳答案

将此添加到底部 apply plugin: 'com.google.gms.google-services' in app level '并使用 this最新的 firebase 依赖项,如果您使用的是 android studio 3.x 版本,请使用 'com.google.firebase:firebase-plugins:1.1.5'

关于android - com.google.android.gms.internal.firebase-perf.zzq.zzb(boolean)' 在空对象引用上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50459628/

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