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.

Generate "universal" apk for specific config.

See original GitHub issue

Is your feature request related to a problem? Please describe.

I want to be able to generate a single “universal” apk that contains only the split APKs that I select via a device config and not all of them. e.g. I would want a universal APK with just the arm64-v8a ABI, or I want a “universal” apk with just xhdpi resources.

Describe the solution you’d like

Either the ability to allow --connected-device and --device-spec with subsets of that configurations e.g. (only abi)

Describe alternatives you’ve considered

Manually/Automatically merging a subset of split APKs.

Additional context

I understand that the PlayStore would never generate and serve such an apk but we would need to generate that APKs for different release channels and want to generate them form the same built Bundle and not build another binary.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
plecesnecommented, May 26, 2020

This was an attempt at using a feature from the Android platform to put APKs on the system image compressed. However, there were some bugs in the feature and thus cannot be used as is. I would advise against using this option, we are likely to remove it from bundletool soon.

1reaction
plecesnecommented, May 26, 2020

Great question.

Yes indeed, the --mode=system has been introduced for the system image purpose.

As for the differences:

  • --mode=standalone would include the string for all languages, while --mode=system would include only the languages specified in the device spec (or all of them if you leave that field empty). In the latter case, Play Store will download the strings for languages defined in the system settings at the earliest opportunity, and developers using a custom language picker also have the possibility to download the needed languages manually using the Play Core SDK.
  • Standalone APKs are meant to be deployed to pre-L devices, while System APKs are targeted for recent versions of Android, so there may be optimizations done on system APKs that are disabled for standalone APKs. One that comes to mind is native support for multidex, but there may be others.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Build multiple APKs | Android Developers
Gradle can create separate APKs that contain only code and resources specific to each density or ABI. This page describes how to configure...
Read more >
Generate Apk file from aab file (android app bundle)
This solution will generate a universal binary as an apk. Add --mode=universal to your bundletool ... Generate a device-specific set of APKs
Read more >
Universal Apk, a survival guide - pgreze
Pretty easy. Just generate an AAB from Gradle and use bundletool to target a specific device. bundleDebug output changed between AGP 3.4.2 ...
Read more >
How to create an APK from the Android App Bundle - Droidcon
The --bundle=path and --output=path are required and the --mode=universal is optional, but in this case, it will be required because it is ...
Read more >
Android App Bundles, how to generate APK from AAB
This command will also create an APKS file but if you take a look at its ZIP contents, you will find only a...
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