即时应用崩溃adview.loadAd,SecurityException:无法找到提供商com.google.android.gsf.gservices

时间:2017-07-13 19:03:04

标签: android google-play-services android-instant-apps

我正在使用播放服务广告10.2.6,它与已安装的应用程序配合得很好。

这是堆栈跟踪:

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.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        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:767)
     Caused by: 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:1948)
        at android.os.Parcel.readException(Parcel.java:1894)
        at android.content.IContentService$Stub$Proxy.registerContentObserver(IContentService.java:768)
        at android.content.ContentResolver.registerContentObserver(ContentResolver.java:1924)
        at android.content.ContentResolver.registerContentObserver(ContentResolver.java:1913)
        at zh.a(:com.google.android.gms.DynamiteModulesA:7)
        at zh.a(:com.google.android.gms.DynamiteModulesA:84)
        at jg.<init>(:com.google.android.gms.DynamiteModulesA:14)
        at jf.<init>(:com.google.android.gms.DynamiteModulesA:1)
        at com.google.android.gms.ads.clearcut.a.<init>(:com.google.android.gms.DynamiteModulesA:6)
        at com.google.android.gms.ads.internal.ag.a(:com.google.android.gms.DynamiteModulesA:1)
        at com.google.android.gms.ads.ChimeraAdManagerCreatorImpl.newAdManagerByType(:com.google.android.gms.DynamiteModulesA:17)
        at com.google.android.gms.ads.internal.client.an.onTransact(:com.google.android.gms.DynamiteModulesA:63)
        at android.os.Binder.transact(Binder.java:604)
        at com.google.android.gms.ads.internal.client.ak.newAdManagerByType(:com.google.android.gms:3)
        at com.google.android.gms.ads.AdManagerCreatorImpl.newAdManagerByType(:com.google.android.gms:12)
        at com.google.android.gms.ads.internal.client.aj.onTransact(:com.google.android.gms:32)
        at android.os.Binder.transact(Binder.java:604)
        at com.google.android.gms.internal.zzeu$zza$zza.zza(Unknown Source:56)
        at com.google.android.gms.internal.zzeb.zza(Unknown Source:17)
        at com.google.android.gms.internal.zzek$1.zzeI(Unknown Source:15)
        at com.google.android.gms.internal.zzek$1.zzeJ(Unknown Source:0)
        at com.google.android.gms.internal.zzek$zza.zzeR(Unknown Source:0)
        at com.google.android.gms.internal.zzek.zza(Unknown Source:32)
        at com.google.android.gms.internal.zzek.zza(Unknown Source:11)
        at com.google.android.gms.internal.zzff.zzfj(Unknown Source:39)
        at com.google.android.gms.internal.zzff.zzfi(Unknown Source:21)
        at com.google.android.gms.internal.zzff.zza(Unknown Source:4)
        at com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source:6)
        at com.google.android.gms.ads.AdView.loadAd(Unknown Source:0)
        at <activity_name>.loadAdView(<activity_name>.java:2416)

2 个答案:

答案 0 :(得分:1)

  

我正在使用播放服务广告10.2.6

始终确保您使用的是最新的库版本。

请更新到最新版本,目前为11.0.2。

Firebase Android Release Notes

答案 1 :(得分:0)

AFAIK,存在基于此GitHub post的现有问题,并且还存档于issue tracker。查看您遇到的问题是否与其中任何问题相关,并遵循给定的解决方法(如果有)。

另一方面,由于SecurityException崩溃通常是因为未经许可阅读gservices。您可能还想尝试requesting permissions at Run Time

如果您还没有这样做,请注意,在所有Android版本上,您的应用需要在其应用清单中声明两类系统权限,即正常权限和危险权限。查看declaring permissions了解详情。