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.

bundletool build-apks `--connected-device` or `--device-spec` flag/parameter are not working

See original GitHub issue

Describe the bug I’ve referred Google IO’18 official session youtube video: https://youtu.be/bViNOUeFuiQ?t=1324 and it says that you can generate the apk set archive for the connected device from the app bundle during testing phase.

I’m trying to run the following command which should generate the apk set for connected device or as per the device-specs. These both commands are not working and giving me the following error.

bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --connected-device bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --device-spec=pixel2.json

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

Stacktrace $ bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --connected-device

WARNING: The APKs won’t be signed and thus not installable unless you also pass a keystore via the flag --ks. See the command help for more information. [BT:0.3.3] Error: Unrecognized flags: --connected-device com.android.tools.build.bundletool.utils.flags.ParsedFlags$UnknownFlagsException: Unrecognized flags: --connected-device at com.android.tools.build.bundletool.utils.flags.ParsedFlags.checkNoUnknownFlags(ParsedFlags.java:90) at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:239) at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:191) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:72) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:44)

$ bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --device-spec=pixel2.json

WARNING: The APKs won’t be signed and thus not installable unless you also pass a keystore via the flag --ks. See the command help for more information. [BT:0.3.3] Error: Unrecognized flags: --device-spec com.android.tools.build.bundletool.utils.flags.ParsedFlags$UnknownFlagsException: Unrecognized flags: --device-spec at com.android.tools.build.bundletool.utils.flags.ParsedFlags.checkNoUnknownFlags(ParsedFlags.java:90) at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:239) at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:191) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:72) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:44)

To Reproduce Steps to reproduce the behavior.

  • Use the above-mentioned command to install the application to the connected device.

bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --connected-device

Expected behavior It should generate the apk archive set for the connected device or as per the device spec json file.

Known workaround Don’t know

Environment: OS: MAC, High Sierra 10.13.4 Device : Pixel2 XL

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
saurabhkpatelcommented, May 31, 2018

@rksinghj4 For the first error, did you set the ADB path? If not then set it or use the full absolute path of adb. for the second error, I think there is a problem with --, make sure you’ve written the correct command. copy-paste sometimes creates the problem.

1reaction
plecesnecommented, May 22, 2018

after merging those 4.

As I explained, there is no merging involved. The 4 APKs are served and installed on the device as is.

Those 4 APKs should be installed together (using “adb install-multiple”) for the app to work. The command “install-apks” from bundletool will do that automatically.

For your investigation purposes, I would suggest to seek help on a different forum, such as stackoverflow with the tag #androidappbundle

On Tue, 22 May 2018, 20:09 Saurabh Patel, notifications@github.com wrote:

@plecesne https://github.com/plecesne thanks. That’s it? Is it final to consider the total size of the 4 apks as a benchmark? I thought there must be different size after merging of those 4.

Is it possible to install one by one those 4 apks?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/bundletool/issues/9#issuecomment-391106890, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1cWUrLxZJAY0I50B_I0xvLR1DqpSIPks5t1GJlgaJpZM4UGiY- .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android App Bundle Part-2 : BundleTool | by Saurabh Patel
bundletool build-apks ` — connected-device` or ` — device-spec` flag/parameter are not working. Update : They're working on it.
Read more >
bundletool - Android Developers
Instructs bundletool to build APKs that target the configuration of a connected device. If you don't include this flag, bundletool generates ...
Read more >
Bundletool and how to utilize Android App Bundle - N47
The command build-apks is used to build an APK set for the bundle. ... this work to the useful command of bundletool ,...
Read more >
I can't Install Apk from android app bundle using command ...
Assuming you are testing on just one device first generate the bundle only for your connected device using the following. bundletool build-apks ......
Read more >
Error while publishing AAB to internal sharing console after ...
Ensure that your app bundle is valid by running bundletool build-apks locally and try again" as also attached in the image here". Also,...
Read more >

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