question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bundle tool "install apks" command isn't working sometimes.

See original GitHub issue

Describe the bug Bundle tool install apks command isn’t working bundletool install-apks --apks=my_app.apks on Nexus 6P device (Android Oreo) sometimes. Although it doesn’t give any problem for Google Pixel 2 XL.

I tried to run the following the command to get the device specs. but got the following weird output. Do you know what could be the cause of this?

$ bundletool get-device-spec --output=nexus6p.json
Warning: Can't detect device locale, will use 'en-US'.

$ cat nexus6p.json
{
  "supportedLocales": ["en-US"],
  "screenDensity": 4294967295,
  "sdkVersion": 1
}%

Bundletool version(s) affected Version: [e.g. 0.3.3]

Stacktrace $ bundletool install-apks --apks=my_app.apks

Warning: Can’t detect device locale, will use ‘en-US’. [BT:0.3.3] Error: Installation of the app failed. com.android.tools.build.bundletool.exceptions.InstallationException: Installation of the app failed. at com.android.tools.build.bundletool.exceptions.InstallationException$Builder.build(InstallationException.java:47) at com.android.tools.build.bundletool.exceptions.InstallationException$Builder.build(InstallationException.java:41) at com.android.tools.build.bundletool.device.DdmlibDevice.installApks(DdmlibDevice.java:98) at com.android.tools.build.bundletool.device.ApksInstaller.installOnDevice(ApksInstaller.java:89) at com.android.tools.build.bundletool.device.ApksInstaller.installApks(ApksInstaller.java:78) at com.android.tools.build.bundletool.device.ApksInstaller.installApks(ApksInstaller.java:45) at com.android.tools.build.bundletool.commands.InstallApksCommand.lambda$execute$4(InstallApksCommand.java:138) at com.android.tools.build.bundletool.io.TempFiles.lambda$withTempDirectory$0(TempFiles.java:67) at com.android.tools.build.bundletool.io.TempFiles.withTempDirectoryReturning(TempFiles.java:51) at com.android.tools.build.bundletool.io.TempFiles.withTempDirectory(TempFiles.java:70) at com.android.tools.build.bundletool.commands.InstallApksCommand.execute(InstallApksCommand.java:122) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:85) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:44) Caused by: com.android.ddmlib.InstallException: List of APKs is empty: the main APK must be specified. at com.android.ddmlib.Device.installPackages(Device.java:930) at com.android.tools.build.bundletool.device.DdmlibDevice.installApks(DdmlibDevice.java:92) … 10 more Caused by: java.lang.IllegalArgumentException: List of APKs is empty: the main APK must be specified. at com.android.ddmlib.SplitApkInstaller.validateArguments(SplitApkInstaller.java:214) at com.android.ddmlib.SplitApkInstaller.create(SplitApkInstaller.java:237) at com.android.ddmlib.Device.installPackages(Device.java:925)

To Reproduce Steps to reproduce the behavior.

  • Generate the apks set archive.
  • install the apk from this apks set.

Environment: OS: MAC OS Device : Nexus 6p

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gajendrakumartwinwalcommented, Oct 4, 2018

No this command is not working but after making below changes it is working fine.

Thanks for such a quick response. Solved:

Before change: export ANDROID_HOME=/Users/Gajendra/Library/Android/sdk/platform-tools export PATH=$PATH:${ANDROID_HOME}

After change: export ANDROID_HOME=/Users/Gajendra/Library/Android/sdk export PATH=$PATH:${ANDROID_HOME}/platform-tools

0reactions
plecesnecommented, Oct 4, 2018

The ANDROID_HOME variable should be set to the path to the root of the Android SDK, not platform-tools or any of the other subdirectories.

Read more comments on GitHub >

github_iconTop Results From Across the Web

apk does not install after generated by bundletool
The only way is to install them is via a computer and a cable either via bundletool install-apks command (using the .apks files), ......
Read more >
bundletool - Android Developers
To deploy your app from an APK set, use the install-apks command and specify the path of the APK set using the --apks=...
Read more >
Android App Bundles, how to generate APK from AAB
Bundletool is a command line java program. It consumes a single AAB file to create an APKS (not to confuse with APK) file....
Read more >
Why aab and apk file works differently? : r/androiddev - Reddit
You don't need bundletool to test your app. In studio if you edit run configuration > Install Options > change Deploy to "APK...
Read more >
Why Google Play's APK replacement is scaring some security ...
Since Android App Bundles aren't APKs, you can't just open an AAB file and install it directly onto a device. When you upload...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found