我有一个即时应用程序项目,经过几个障碍后我能够在模拟器上运行(Nexus 5X API 26)
Android: Instant app showing just white screen
现在,2 个月后,我尝试运行同一个项目,但没有成功
Nexus 5X(任何 api):
Adb devices
给出以下结果
像素 API 24:
侧面加载失败并显示消息:尝试读取 bundle 时失败。无法连接到 Google Play 服务。
ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED,resolution=空,消息=空
物理设备:
配置失败并显示消息:使用的设备未列入免安装应用程序部署的白名单。
根据文档的 Instant apps work on
Most Android devices running Android 5.1 (API level 21) or higher.
我试过的设备
- 红米 Note 3(棉花糖)
- Moto G4 plus(牛轧糖)
Android Studio 版本 3
如何让它发挥作用?
最佳答案
Pixel API 24 模拟器:
您需要安装具有 Google API 的 Android 系统镜像。您可以在创建新模拟器时看到这些图像,它们的名称类似于:“Android 7.1.1 (Google APIs)”。
确保您的模拟器中安装了最新版本的 Google Play 服务。为此:转到模拟器的扩展控件(通过单击三个点)-> Google Play -> 更新。请注意,这仅在您使用 Google API 安装系统镜像时可见(请参阅第 1 步。)
确保您在设备/模拟器上启用了免安装应用程序。请参阅:https://support.google.com/googleplay/answer/7240211?hl=en
物理设备:
只有少数选定的设备(例如 Pixel)与即时应用开发兼容。
参见:https://github.com/googlesamples/android-instant-apps/issues/1
参见 developer documents关于为 Instant Apps 开发设置设备或模拟器。
关于android - 即时应用程序未在模拟器上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47671320/