64 bit version issue in react-native android app b

2020-02-02 08:29发布

问题:

According to https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html:

In August 2019, Play store will require that new apps and app updates with native libraries provide 64-bit versions in addition to their 32-bit versions.

I have a React Native application (which includes native code). My question is how can I know whether a third party library I'm using or even my own code is not supporting 64-bit? And how can I fix it?

Update

I added x86_64 to my build.gradle and I now see the x86_64 folder in the apk but I think some of the files are missing.

Here is, how my x86 folder looks like:

And here is how my x86_64 folder looks like:

回答1:

React Native will support 64 bit for android starting version 0.59

https://github.com/facebook/react-native/issues/2814#issuecomment-457688789

https://github.com/facebook/react-native/commit/f3e5cce4745c0ad9a5c697be772757a03e15edc5



回答2:

All of the native code for an app is stored in the libs/ directory in the root of the apk. eg for compiled ARM or x86 code, you can find it in libs/architecture_type/lib_name.so.

An APK is essentially just a zip file so you can extract it with any zip tool.

The list of architectures (ABIs) is here. If you don't have directories for arm64-v8a or have x86 but don't have x86_64 then you are missing the 64 bit native code.



回答3:

https://github.com/facebook/react-native/issues/2814

Facebook seems to be dragging their feet on supporting 64 bit builds.

You can check the intermediates in the build folder to see what abis you are supporting.

https://developer.android.com/ndk/guides/abis.html

Android takes the lowest common denominator of build abi. This is going to become an issue if Facebook doesn't address it soon.



回答4:

React native has been released the new version of the react native on 12 march. In this new version react native support the 64 bit systems. You can read more detail about this on below link. http://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059



回答5:

react-native new versions support 64 bit automatically. just update react-native version to 0.59.0 or after and rebuild your application, just run:

react-native upgrade 0.59.1