将Firebase Analytics添加到Instant App [英] Adding Firebase Analytics to Instant App

查看:64
本文介绍了将Firebase Analytics添加到Instant App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将现有应用程序转换为Android Instant App.我已经成功做到了.我的应用程序以即时应用程序"形式运行.我现在面临的问题与Firebase-Analytics有关.当我运行即时应用程序时,出现此错误

I am converting my existing application to Android Instant App. I have successfully done that. My app is running in Instant App form. The issue that I am facing now is regarding Firebase-Analytics. When I run instant app I get this error

E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.

当我尝试使用FirebaseAnalytics.getInstance(this);获取FirebaseAnalytics实例时,即时应用程序崩溃.我无法在Logcat上获得任何日志.我的已安装"应用运行正常.另外,如果有人可以指导我如何调试Instant Apps,我将无法对其进行调试,甚至无法在Logcat上获取日志.

When i try to get FirebaseAnalytics instance using FirebaseAnalytics.getInstance(this); the instant app crashes. I am not able to get any sort of logs on Logcat. My "Installed" app is working perfectly fine. Also if someone can guide me on how to debug Instant Apps, I am not able to debug them or even get logs on Logcat.

修改 链接到错误报告

推荐答案

适用于Instant Apps 2.7-release-179555567的Google Play服务

参考 Google问题跟踪器

您的Instant Apps版本的Google Play服务为1.22 ...

Your Google Play services for Instant Apps version is 1.22...

如果您更新到最新版本,请使用以下命令修复该问题:2.7 +

If you update to the latest, it should be fixed with: 2.7+

  1. 卸载适用于Instant Apps的Google Play服务
  2. 返回设置> Google>即时应用
  3. 它将要求您还原它>还原
  4. 现在尝试再次运行您的即时应用.

如果尝试从Android Studio构建即时应用程序时遇到此问题,则可能不得不再重复1-4步.第一次配置时,它可能会以错误的版本(1.22 ...)安装您的设备,但是之后,它应该是正确的版本.

If you are experiencing this while trying to build your instant app from Android Studio, you may have to repeat steps 1-4 one more time. On first provisioning, it may install your device with the incorrect version (1.22...), but afterwards, it should be the correct version.

这解决了我的问题,但用户是否将始终拥有适用于Instant Apps(即2.7+)的最新Google Play服务?因为我没有为Instant Apps侧加载Google Play服务,还是Android Studio安装了该服务?

回答:- 是的,O之前的用户应定期向Instant Apps推送最新的Google Play服务.另外,他们始终可以执行第1-3步,以确保获得最新的信息.

Ans:- Yes, users on pre-O should be periodically pushed the latest Google Play services for Instant Apps. Plus, they can always perform steps 1-3 to make sure they get the latest.

在O +上,他们也不需要做任何事情,因为从现在开始,Instant Apps支持直接内置在框架中.

On O+, they shouldn't have to do anything either, since Instant Apps support is built directly into the framework from here on out.

与OEM合作,已将适用于Instant Apps的Google Play服务推送到所有与Instant Apps兼容的设备上.另一种情况是,当您尝试将即时应用构建到列入白名单的设备时,Android Studio会安装它.

Working with the OEMs, Google Play services for Instant Apps have been pushed to all devices which have been deemed compatible for Instant Apps. The other case is where Android Studio installs it when you try to build your instant app to a whitelisted device.

这篇关于将Firebase Analytics添加到Instant App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆