Android Instant App未正确安装(行为与普通应用类似) [英] Android Instant App not being installed correctly(Behaves like a normal app)

查看:153
本文介绍了Android Instant App未正确安装(行为与普通应用类似)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试通过以下步骤在手机上启动即时应用程序:

I am trying to launch an instant app to the mobile using the following steps:


  1. 在Android Studio中生成已签名的即时应用程序apk ,这将生成一个包含基本apk文件和功能apk文件的zip文件。

  2. 解压缩生成的文件。

  3. 使用命令 adb install-multiple -r -t * .apk 即可安装该应用。
    被告知要使用 adb install-multiple -r -t --instantapp * .apk 但要使用-instantapp 标记将给我以下错误:
    转储时发生异常:
    java.lang.IllegalArgumentException:未知选项--instantapp

  1. Generate signed apk of Instant App in Android Studio, which would produce a zip file containing Base apk file and feature apk files.
  2. Unzip the generated file.
  3. Use command adb install-multiple -r -t *.apk to install the app. I was told to use adb install-multiple -r -t --instantapp *.apk but --instantapp tag would give me a following error: Exception occurred while dumping: java.lang.IllegalArgumentException: Unknown option --instantapp

因此,我希望即时应用程序可以安装在我的移动设备中。有趣的是,Instant App是可启动的,但是它会创建一个普通的应用程序图标,就好像它不是即时应用程序一样。如果我去设置-> google->即时应用程序,则已安装的即时应用程序列表为空。

So after doing this, I would expect instant app to be installed in my mobile device. Interestingly, Instant App is launchable, however it creates a normal app icon as if it is not an instant app. If I go Setting -> google -> Instant Apps, list of installed instant app is empty.

此外,以这种方式安装的即时应用程序的行为不同于即时直接在Android Studio中使用 Run 安装的应用。

Also, the behaviour of Instant App installed this way is different from the Instant App installed directly using Run in Android Studio.

我使用的设备是Google Pixel(8.0.0)和Nexus 5X(7.1.1)。

The devices I used are Google Pixel(8.0.0) and Nexus 5X(7.1.1).

感谢您的帮助。

推荐答案

一种更简单的方法是使用Instant Apps SDK 1.2及更高版本中提供的Instant Apps CLI。使用SDK管理器(在Android Studio中或从命令行版本)下载SDK,然后将 extras / google / instantapps / ia (在SDK文件夹中)添加到PATH中。

A much easier way to do this is using the instant apps CLI present in the Instant Apps SDK versions 1.2 and above. Download the SDK using the SDK manager (either in Android Studio or from the command line version) and add extras/google/instantapps/ia (inside your SDK folder) to your PATH.

然后,您可以执行 ia run< something.zip> 在以下任何受支持的设备上启动即时应用程序命令行。请注意,如果您使用的是模拟器,请确保设备上的Google Play服务版本是最新的(您可以从模拟器的控制面板中对其进行更新)。

Then you can do ia run <something.zip> to launch instant apps on any supported device from the command line. Note that if you're using an emulator, make sure the version of Google Play services on the device is up to date (you can update it from the emulator's control panel).

这篇关于Android Instant App未正确安装(行为与普通应用类似)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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