我按照本文档设置Play Asset Delivery,它在我的应用程序中下载了一些点播包
当我上传到谷歌播放内部测试/生产频道时,它在我的所有设备上都能很好地工作。
assetPackManager.registerListener(downloadListener)
assetPackManager.fetch(listOf(packageName)).addOnCompleteListener{ res ->
Timber.i("Download $packageName ${res.isSuccessful}")
}
但我收到了许多来自firebase crashlytics的错误报告,我不知道如何解决:
Fatal Exception: java.lang.Exception com.google.android.play.core.assetpacks.b: -11:
Asset Pack Download Error(-11): The Play Store app is either not installed or not the
official version.
(https://developer.android.com/reference/com/google/android/play/core/assetpacks/model/AssetPackErrorCode.html#PLAY_STORE_NOT_FOUND) at
com.google.android.play.core.assetpacks.e0.l(Unknown Source:21) at
com.google.android.play.core.assetpacks.e0.f(Unknown Source:4) at
com.google.android.play.core.assetpacks.o4.g(Unknown Source:19) at
com.bookbot.i.s(Unknown Source:231) at com.bookbot.i.C(Unknown Source:24) at
com.bookbot.i.f(Unknown Source:0) at com.bookbot.h.run(Unknown Source:6) at
android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7397) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
这个文档说The Play Store app is either not installed or not the official version
,但我真的不明白。我的应用程序只是通过应用捆绑包发布到google play中,我没有发布到其他任何地方,所以我想知道为什么它说playstore不是官方的?
以下是一些受影响的设备:
AT&T Fusion Z (android 10)
Galaxy S9 (android 10)
vsmart (android 11)
有什么办法解决这个问题吗?或者至少可以检查Play资产交付是否不支持该设备?
好吧,错误消息会告诉你到底出了什么问题——这些特定设备的Play Store应用程序要么被删除,要么被禁用。或者它们可以被root,然后Play Store应用程序被修改。或者,这些设备可以在根本没有谷歌服务的情况下设置,并使用替代应用商店。
不过,这很容易测试。只需使用GoogleApiAvailability
:
val result = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(activityContext)
从那里你可以实现你自己的逻辑,或者让谷歌显示他们的错误对话框:
val dialog = GoogleApiAvailability.getInstance().getErrorDialog(activityContext, result, 123)
dialog?.show()
您也可以设置onActivityResult()
以检查来自错误对话框的响应