nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

Android 64-bit aab build triggering error mentioned on August 1, 2019 which does not allow app to be pushed for review

Open devincheca opened this issue 7 years ago • 2 comments

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: tns --version 3.2.0
  • Cross-platform modules:
  • Android Runtime: 28
  • iOS Runtime:
  • Plugin(s):

Describe the bug build time error for uploading and meeting 64-bit google play requirement full error and details below

To Reproduce clone this repo https://github.com/devincheca/nativeScriptTodoList run any tns build android tns cloud build android sidekick build etc

Expected behavior .aab file that does not trigger 64-bit error

The issue here is that I have no way of creating a build that allows me to meet the 64-bit requirement in Google Play and submit the app for review. I have tried nearly every documented and undocumented (more on that below) way of running ‘tns build android’ and cannot create a build/bundle that meets this requirement. I have tried generating an android cloud build from NativeScript Sidekick and was not able to meet the requirement. No matter what I try, I still end up with the following error: Error This release is not compliant with the Google Play 64-bit requirement The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code: 8. Include 64-bit and 32-bit native code in your app. Use the Android App Bundle publishing format to automatically ensure that each device architecture receives only the native code it needs. This avoids increasing the overall size of your app. Learn More Upon clicking 'Learn More' I am brought to this link: https://developer.android.com/distribute/best-practices/develop/64-bit

The source code for my app is linked here: https://github.com/devincheca/nativeScriptTodoList It is a simple todo list application that should not be so complicated to create a passing build.

I understand this issue was reported at: https://github.com/NativeScript/nativescript-cli/issues/4330 but the solutions listed towards the bottom of the post did not appear to reach a consensus especially when running tns build android --bundle --release --key-store-path upload-key.keystore --key-store-password *** --key-store-alias upload-key --key-store-alias-password *** --aa This command documented here https://docs.nativescript.org/tooling/docs-cli/project/testing/build-android does not include the --bundle command and yet the --bundle command is mentioned in issue #4330 even when running the command with --bundle, the error still appears also, I believe there was a typo in that --aa should be --aab that issue mentioned opening another issue with a detailed description of the google play error which is my intent with this issue report I am running tns --version 6.2.0 I also tried running the cloud build from NativeScript Sidekick and was given the same warning listed above and the following error listed below due to the size of the apk. Unoptimized APK Warning: This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimizing your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower install success rates and take up storage on users' devices. Resolution: Use the Android App Bundle to automatically optimize for device configurations, or manage it yourself with multiple APKs. It appears that a bundle gets rid of this warning; however the 64-bit error still remains no matter which approach I take. When running --env.aov, --env.compileSnapshot, and etc. it does give me a build as an aab and the above warning is eliminated; however, more importantly, the error still exists which does not allow me to continue through the review process. I like the NativeScript framework and appreciate the work done by Telerik and Progress; however, this seems like a crushing shortcoming that gets in the way of deploying an application and I would greatly appreciate any assistance with this problem.

devincheca avatar Nov 11 '19 02:11 devincheca

Hi @devincheca, The 'x86_64' architecture was added by default in NativeScript Android Runtime v6.0.2 - here. The example you referenced uses version 6.0.0. To solve your issue update Android Runtime in your project - tns platform add [email protected] and then build the project with:

tns build android --release --aab --key-store-path **** --key-store-password **** --key-store-alias **** --key-store-alias-password ****

KristianDD avatar Nov 12 '19 17:11 KristianDD

thank you for the help this was a quick response and resolution for this issue I ran the commands you mentioned and incremented the version code and it passed without the error in the Google Play Console I also added the --env.aot --env.uglify --env.etc... flags to optimize the build and those worked too after runninng tns platform add [email protected]

devincheca avatar Nov 12 '19 19:11 devincheca