Bundle tool "install apks" command isn't working sometimes.
See original GitHub issueDescribe 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:
- Created 5 years ago
- Comments:11 (6 by maintainers)
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
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.