tldr: You also need to compile AppCompat resources since you're building all of this by hand, and pass them to link the same way you do with your local resources (the order matters to keep the correct overlays/overrides).
The way the Android Gradle Plugin handles resources in an app level is:
- merge all the resources (local app, local libraries, remote libraries, extra resource source-sets etc)
- compile everything using 'aapt2 compile' (with or without PNG crunching)
- link everything into an APK
Bundle tool "install apks" command isn't working sometimes.
Unable to generate APKs using bundletool in Android Studio - Stack Overflow
bundletool build-apks `--connected-device` or `--device-spec` flag/parameter are not working
Bundletool install-apks command only installs partial set of APKs if device-spec.json does not match device spec.
Execute bundletool from the command line as follows. Make sure paths to java/bundletool/aab/jks are set and correct.
java -jar bundletool-all-0.6.0.jar build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks --ks=keystore.jks --ks-key-alias=key0
For those who are looking to generate a universal APK from the .aab file on mac, you can use the below steps
Use the following command to generate the '.apks' file from the '.aab' file: java -jar bundletool-all-1.1.0.jar build-apks --bundle=/path_to_aab/myapp.aab --output=/path_to_aab/myapp.apks --mode=universal
Rename the myapp.apks file to myapp.zip
Unzip and you will find universal apk
It's very simple. You can create android app bundles (.aab) file from android source by this command :
gradlew bundle
OR
gradle bundle
You cannot simply convert an APK to an App Bundle. You have to use a build system that supports building App Bundles from source, like Android Studio (which uses Android Gradle plugin) or others.
Bundletool has a build-bundle command but it is meant to use by build systems since you need already precompiled dex code, and resources compiled in a proto format.
Hi
I'm having a strange behaviour when trying to generate a release apk for my App
I'm using latest RN, latest NativeBase UI Library, etc.
When executing
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
I get some errors related to "react-native-svg", which I've reported here
https://github.com/software-mansion/react-native-svg/issues/2029
But yesterday (searching for help about that bug) I've found that I could generate an apk using Yarn. So decided to give it a try and executed the following command
yarn react-native bundle --reset-cache --entry-file index.js --platform android --bundle-output test.bundle --dev false
For my surprise, the above command executed successfuly and an apk (debug) was generated in
./android/app/build/outputs/apk/debug/app-debug.apk
Command output:
info Writing bundle output to:, test.bundle info Done writing bundle output warn Assets destination folder is not set, skipping... Done in 27.47s.
Questions:
Does anyone know why this behaviour between the 2 commands? Is any of those malformed?
Can anyone point me to a yarn command that can generate a release apk and not debug ?
Thanks