Skip to content

Android 64 bit Support needs to be enabled by default #4330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NathanaelA opened this issue Jan 31, 2019 · 83 comments
Closed

Android 64 bit Support needs to be enabled by default #4330

NathanaelA opened this issue Jan 31, 2019 · 83 comments

Comments

@NathanaelA
Copy link
Contributor

Describe the issue
By August 1st, Google will require apps to have 64 bit support enabled in addition to the 32 bit support.

Because the actual nativescript runtimes are native code (i.e. c/c++) this is a requirement we have to do, so getting this re-enabled by default; sooner than later will simplify everyone's life before the Aug 1st deadline.

Additional context
The 64 bit runtimes are shipped, but in the past were disabled by default to keep the .apk size smaller.
Indirectly related to #1392

@rosen-vladimirov
Copy link
Contributor

Hey @NathanaelA ,
Thanks for bringing the attention to this new requirement. We'll discuss it internally and come up with a suggestion how to support this. It looks like we'll have to enable builds for both armv7 and arm64 architectures by default. This will make the build slower, so we may enable it for release builds only. At the moment users can control the architectures from the app.gradle file in the project, but we may add some command line flag to make it easier. What do you think for all of these ideas?

@NathanaelA

This comment was marked as abuse.

@brndusic
Copy link

I added this to my app.gradle and it worked fine.

defaultConfig {
       ......
       ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}

@racknoris
Copy link

@brndusic Did you have any troubles in google play? Did the added 64 bit support affect any plugins?

@rosen-vladimirov Is this line what you were planning to add when using a flag?

@brndusic
Copy link

@racknoris I haven't noticed any problem. Warning on google play went away after I built this way.

@rosen-vladimirov rosen-vladimirov self-assigned this May 20, 2019
@nlmunro
Copy link

nlmunro commented May 24, 2019

I can confirm this solved it for me - using geolocation, firebase, localstorage and som UI plugins.

@racknoris
Copy link

@brndusic It seems that this is the official way to do it, does it do the same as your way?

android {
....
  defaultConfig {
    ....
    ndk {
      abiFilters.clear()
    }
  }
....

@lambourn
Copy link

Maybe I'm missing something here - I just built the Android version of our app and set the app.gradle as suggested by @brndusic

defaultConfig {
       ......
       ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}

however, running APK Analyze from Android studio I do not see libNativeScript.so for x86_64:

apk-analyzer

@racknoris
Copy link

@lambourn could you please try in the way I found as well? perhaps it'll work

@lambourn
Copy link

@racknoris I did. Same result.

@brndusic
Copy link

@racknoris I have not analyzed .apk file, the thing it solved for me is that there is no more warning on app store about 64 bit support.

@lambourn
Copy link

@brndusic good to know. Maybe the Play Store is fine with just the arm64 binaries being present as x86_64 is not a relevant platform for Android mobile phones / tablets?

@ExaltedJim
Copy link

I am experiencing a crash of my app on startup when running it on an Android emulator with the CPU set to x86_64. This is because libNativeScript.so is missing from lib/x86_64 folder of the apk (it is present for all other architectures - x86, arm64-v8a, armeabi-v7a). Is there a plan to have a x86_64 version of libNativeScript.so?

@felixkrautschuk
Copy link

@ExaltedJim ,
do you see any crash information in the logs?

@romandrahan
Copy link

romandrahan commented Jul 10, 2019

@ExaltedJim, same for me: https://take.ms/I5EuD

@kzimny
Copy link

kzimny commented Jul 10, 2019

My app.gradle looks as follow:

android {
  defaultConfig {  
    generatedDensities = []
	  applicationId = "com.aaaaa.nativeapp"
    ndk {
      abiFilters.clear()
    }
  }  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }  
} 

.apk package contains lib\arm64-v8a; lib\armeabi-v7a and lib\x86 folders with libNativeScript.so library
image

Where is the libs\x86_64 folder? Do I miss something or it is expected?

Update
the app is running on an Android emulator with the CPU set to x86_64. Can someone explain why the app is running without libNativeScript.so library in x86_64 folder and why the folder has not been created? Thanks!

@Serge-SDL
Copy link

same problem here and the deadline to update app is august first!

@dmdnkv
Copy link

dmdnkv commented Jul 11, 2019

The same problem.
It was decided to skip x86 platform support for our app as a workaround since almost 99% of mobile devices use ARM.
The following config could help:

 defaultConfig {
   generatedDensities = []
   ndk {
       abiFilters.clear()
       abiFilters.addAll(['armeabi-v7a','arm64-v8a'])
   }
 }
 aaptOptions {
   additionalParameters "--no-version-vectors"
 }
}

Supported count of devices was decreased by 6 from 10557 to 10551 (that was displayed in Google Console App releases section after the roll out with that configuration)

@kzimny
Copy link

kzimny commented Jul 11, 2019

Thanks @dmdnkv, indeed not many mobile devices runs on x86 or x86_64 architecture. Found an interesting description here. I'll try with 'armeabi-v7a' and 'arm64-v8a' CPU's only.

@lambourn
Copy link

I just built an app with ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86', exported as .aab. and uploaded it to the Play Store just fine, no complaints about missing 64-bit binaries.

My assumption is that Google does not require x86_64 binaries at all (and if the app is really running on a x86_64 target, e.g. tablet. then the x86 32-bit binaries will be used)

@dmdnkv
Copy link

dmdnkv commented Jul 11, 2019

@lambourn according to this guide Google provided https://developer.android.com/distribute/best-practices/develop/64-bit seems to be that x86_64 is required. There were no complaints about missing x86_64 in Google Console for app I am working on and it is possible to upload the APK without 64bit version but the warning came from Google by email that app doesn't meet the requirement.

image

I did send a message to google support with a question about whether it is fine to have ARM only and stop x86 support to meet the requirements, so hope I'll get the answer soon.

@lambourn
Copy link

@dmdnkv thanks for the heads-up.

I just checked the Android App Bundle report for the uploaded .aab. It turns out that we'd miss 49 device models in total if we remove x86_64 and x86 support for our app. Looks acceptable.

@kzimny
Copy link

kzimny commented Jul 11, 2019

Just uploaded new version to google play with config recommended by @dmdnkv. I miss only five devices if x86 and x86_64 is removed, all of them are wearable devices (watches) which are not relevant for me. Thanks!

@jeremypele
Copy link

@rosen-vladimirov Do you guys plan to publish an official statement/blog post regarding this specific case? August 1st is in 2 weeks

@ExaltedJim
Copy link

@ExaltedJim ,
do you see any crash information in the logs?

@felix-idf sorry I have been busy as of late with other projects - when I find the time I will bring up my app in the 64 bit emulator again and report any crash logs.

Just to let others know, after compiling my app with 'armeabi-v7a', 'arm64-v8a', 'x86' ,'x86_64' enabled, I published the app to the store, and the previous warning I received from Google Play Store about lack of 64-bit support has gone away, however as I've demonstrated in the 64-bit emulator, it won't run.

@dmdnkv
Copy link

dmdnkv commented Jul 12, 2019

@ExaltedJim I had almost the same path, it was 32bit only, then I built with 'armeabi-v7a', 'arm64-v8a', 'x86' , 'x86_64' there were no warnings in the Google Console after upload it but then later after several weeks it was an email from Google on July 10th with a warning about the app didn't meet 64bit requirement.

Did you receive an email from Google?

@n0mer
Copy link

n0mer commented Aug 21, 2019

@Roar1827 this might help for now: NativeScript/NativeScript#7705 (comment)

@Roar1827
Copy link

Thanks @n0mer . We were able to get a build up using that. Looks like we've run into some Android compatibility warnings in the Pre-launch report- not sure how serious they are, but we will do some testing. Thank you for your help!

@rosen-vladimirov
Copy link
Contributor

Hey everyone,
As you've noticed - we've made a significant progress on this issue and we expect to release a patch version tomorrow (August 22nd) in case our tests show everything is working as expected. Meanwhile, in case you have some urgent release, you can use the rc versions of nativescript-dev-webpack and tns-android packages. I.e.:

rm -rf platforms
npm i --save-dev nativescript-dev-webpack@rc
tns platform add android@rc
tns build android --release --env.snapshot...

Stay tuned for more information, hopefully we'll be able to release a fix as planned.

@vinita1505
Copy link

Hi everyone,

If project doesn’t contain any native library or I can say when I analyze the apk I dint got any .so file. So Is my apk or an app is compatible for 64 bit?

@felixkrautschuk
Copy link

@vinita1505 All NativeScript apps for Android are shipped with the V8 JavaScript-engine, which is native code, so any NativeScript developer is affected by this issue.

But the NS team has just released tns-android 6.0.2, so update your project and you should be safe now.

@jnorkus
Copy link

jnorkus commented Aug 22, 2019

But the NS team has just released tns-android 6.0.2, so update your project and you should be safe now.

Is it safe to upgrade platform modules without upgrading to NS6?

@felixkrautschuk
Copy link

@jnorkus no, you have to migrate your project to NS 6 to be able to use the latest Android runtime for your app.

@rosen-vladimirov
Copy link
Contributor

Hey everyone,
We've just released tns-android 6.0.2 and nativescript-dev-webpack 1.1.1.
You need to update both of them (and you need to target NativeScript 6):

rm -rf platforms
npm i --save-dev [email protected]
tns platform add [email protected]
tns build android --release --env.snapshot..

@jnorkus
Copy link

jnorkus commented Aug 22, 2019

Is there any workaround for NS5 users that includes x86 support? Many plugins out there don't support NS6 and most of us are stuck with that.

@etabakov
Copy link
Contributor

@jnorkus we don't plan to bakport this fix to older version as it is not a trivial amount of work. We would rather put effort to support the users in migrating to 6.0. Can you send us a summary of the plugins that incompatible, so that we can try to help where we can? Does this approach sound reasonable to you?

@jnorkus
Copy link

jnorkus commented Aug 22, 2019

@etabakov I can totally understand the reasoning. To be honest I haven't even tried migrating yet. I am assuming it won't work because of the AndroidX breaking change. Once I have time to look into migration I will report my progress.

For the time being I will just exclude x86 support for our apps.

@mtenus
Copy link

mtenus commented Aug 22, 2019

Just uploaded new version to google play with config recommended by @dmdnkv. I miss only five devices if x86 and x86_64 is removed, all of them are wearable devices (watches) which are not relevant for me. Thanks!

@kzimny You need those (x86 and x86_64) mainly to test in emulators

@NathanaelA

This comment was marked as abuse.

@mtenus
Copy link

mtenus commented Aug 23, 2019

@NathanaelA awesome tip 👍 thanks @PeterStaev

@skillbrighterinfotech
Copy link

I just built an app with ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86', exported as .aab. and uploaded it to the Play Store just fine, no complaints about missing 64-bit binaries.

My assumption is that Google does not require x86_64 binaries at all (and if the app is really running on a x86_64 target, e.g. tablet. then the x86 32-bit binaries will be used)

I have do this but not work same issue

@skillbrighterinfotech
Copy link

I added this to my app.gradle and it worked fine.

defaultConfig {
       ......
       ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}

Not work , please help me

@Clifte
Copy link

Clifte commented Aug 26, 2019

Same problem here. added but in bundle file the x86_64 is missing:

'defaultConfig' {
       ......
       ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}

@n0mer
Copy link

n0mer commented Aug 27, 2019

@Clifte please try "clear" first

        ndk.abiFilters.clear()
        ndk.abiFilters.addAll([ 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'])

@sebj54
Copy link

sebj54 commented Aug 28, 2019

@NathanaelA Thank you for the snippet! I also wanted to clarify, the minSdkVersion is not mandatory. I removed it because I still have users with Android < 6 and I was able to publish on Google Play 👌

@nudiref
Copy link

nudiref commented Aug 29, 2019

hello all,

what worked for me in the end was the following configuration:

android {
defaultConfig {
........
ndk {
abiFilters.clear()
abiFilters.addAll(['armeabi-v7a', 'x86','x86_64'])
}
.......
}
}

  • when i include 'arm64-v8a', app will build but it will not launch (crashes as soon as it is launched)
  • i am still using nativescript version 3.4.0. i am not able to upgrade due to many errors upgrade entails.
  • app generated with the configuration above will not work in devices with android version < 9, because of this, i had to use multi-apk feature of android. i created one apk with above configuration for minSdkVersion = 28, and another with no ndk node in app,gradle with maxSdkVersion = 27. with these two, android accepted my release. by having an apk with above configuration was enough to satisfy 64 bit compliance requirement, so, it seems it is enough to include one of 'arm64-v8a' or 'x86_64' to satisfy google's requirement.

i would love to know what is wrong with 'arm64-v8a' package and be able to include it.

@Izrab
Copy link

Izrab commented Sep 9, 2019

I use NativeScript 6.1
Do I need to do anything regarding the 64-bit requirement issue?

@sebj54
Copy link

sebj54 commented Oct 1, 2019

I have NS 6.1.2 on a fresh new project and I still cannot upload an aab file to Google Play.

The bundle has been generated with this command:

tns build android --bundle --release --key-store-path upload-key.keystore --key-store-password *** --key-store-alias upload-key --key-store-alias-password *** --aab

Here is my app.gradle:

// Add your native dependencies here:

android {
  defaultConfig {
    generatedDensities = []
    applicationId = "com.example.app"
  }
  aaptOptions {
    additionalParameters "--no-version-vectors"
  }
}

What did I miss?

@racknoris
Copy link

@sebj54 Did you manage to solve this?

@sebj54
Copy link

sebj54 commented Oct 3, 2019

@racknoris I'm still using this suggestion: #4330 (comment), even with NS 6

@racknoris
Copy link

@sebj54 I see, thank you

@Fatme
Copy link
Contributor

Fatme commented Oct 7, 2019

@sebj54,

It should be enough just executing the command you mentioned:

tns build android --bundle --release --key-store-path upload-key.keystore --key-store-password *** --key-store-alias upload-key --key-store-alias-password *** --aa

No additional actions are required.

However, fell free to open an another issue with detailed description and exact error you received when trying to upload an aab file to Google Play.

@NativeScript NativeScript locked and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests