Android Instant App not being installed correctly(

2019-03-01 01:18发布

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

  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

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.

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

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

Thanks for your help.

3条回答
叼着烟拽天下
2楼-- · 2019-03-01 01:54

I have these in my manifest and it works fine.

<manifest ... 
xmlns:dist="http://schemas.android.com/apk/distribution"
android:targetSandboxVersion="2">
查看更多
孤傲高冷的网名
3楼-- · 2019-03-01 02:09

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.

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).

查看更多
Ridiculous、
4楼-- · 2019-03-01 02:19

The command you were looking for with the install-multiple command is install-multiple -r -t --ephemeral *.apk

查看更多
登录 后发表回答