Prepare Nativescript bundle to publishing Google Play console (debug/release troubles).
1. Preparing application to publishing
Firstly pay attention to correct NS config :
Than we need prepare Manifest file.
Also pay attention, that Gradle script and NS at all working exactly on the same version you need, for example current version is Java 22, but my NS Gradle script working only Java 19.
Despite current version is Java 22
For preparing to publishing we need create Icons with various resolutions:
# ns resources generate icons
Then will appears main step - because Release version usually different than debug. Debug version never crashed because needed modules dynamically add to bundle. This dynamically uploading not working in Release mode, therefore release version usually don't working without additionally efforts.
For example in my case debug version always working fine, but Release version don't working.
Command for run Release version on emulated device is:
# ns run android --release --key-store-path E:\NativeScript\AndroidKeyStore\MyVault.jks --key-store-password XXXXXX --key-store-alias Upload --key-store-alias-password XXXXXX --apk
Command for prepare bundle for publishing is:
# ns build android --release --key-store-path E:\NativeScript\AndroidKeyStore\MyVault.jks --key-store-password XXXXXX --key-store-alias Upload --key-store-alias-password XXXXXX --aab --copy-to dist/release.aab
Pay attention for 2 points, one points that Google Play console accept only *.AAB files (not *.AKP) and second point is low quality Gradle script, in the screen above I miss keyword "implementation" and don't receive even any warnings.
Of course, you need to prepare screenshots for Google with various screen resolution, you need to check what device emulator present in your computer and if it needed prepare device with another resolutions.
2. Analyze Release bundle for trouble.
Of course, this would great luck if Release version working fine instantly and without additional efforts, but is not really case, because Debug version never crashed if library missing, but release version crashed always. Therefore main step is analyzing and comparing Debug and Release versions - what difference?
I used for this purposes this tools - https://marketplace.visualstudio.com/items?itemName=Surendrajat.apklab
I have analyzed and compare two *.APK version.
I started from this point.
And finally, I understand how I must modify my Gradle script.
3. Preparing keys for publishing
For publishing NS bundle we need firstly create JSX key store.
You can check you keystore
3. Final build and uploading.
And finally, we will build release version and upload it to Google Play console.
More about Google Play console you can see in this topic Google Console workflow
|