64 bit version issue in react-native android app by google play store
Asked Answered
C

6

33

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:

enter image description here

And here is how my x86_64 folder looks like:

enter image description here

Clamshell answered 11/2, 2018 at 14:5 Comment(2)
Can you let us know if this was enough to make your Android app compliant? I'm still on RN0.40 and don't wanna upgrade everything.Deterrent
how can you check your compliant? have the same issueSalify
C
25

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

Celebrate answered 28/1, 2019 at 16:26 Comment(6)
React Native 0.59 is released and supports android 64 bit architecture.Celebrate
So I will have to update the react native version to provide the 64 bit architecture support right?Decomposer
I have an app published on Play store using 0.57 version of react native and now I received the mail regarding 64 bit version so what I have to do now? Should I just update the react native version for that project to 0.59 and then publish an update of it?Decomposer
Yes, just upgrade to 0.59 and generate new builds. Upload it, if it works fine!Celebrate
Is there really no way to make it work on earlier versions like react-native 0.57.8 at all? Ive inherited a massive RN project, and while I've tried to upgrade it (it was 0.54 when I received it) moving to 0.58 turned out to be impossible because it no longer works at all wit relay-classic; and I still have almost 200 files still using relay-classic to convert.Express
@SteinG.Strindhaug I believe this wouldn't be possible without upgrading to 0.59+. I would recommend you to invest the time in upgrading. That would definitely be worth it, especially with Hermes it is a no brainer.Celebrate
D
5

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.

Deerdre answered 19/2, 2018 at 17:10 Comment(2)
Thanks!! I updated my build.gradle to compile x86_64 as well but I think it is not enough because there is only one file in the output folder. See my update in the question.Clamshell
With a new React Native project (0.59.8) I have all the libs: x86_64, x86, arm64-v8a, armeabi-v7a and they contain the same files. I suppose that means the APK supports 64 bit.Patino
M
2

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.

Methadone answered 11/4, 2018 at 14:52 Comment(1)
In which folders under intermediates should I check? So far I don't see any abis at all. Hoping that's a good thing.Hesta
L
1

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

Lennie answered 13/3, 2019 at 10:18 Comment(0)
L
1

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
Laundrywoman answered 29/7, 2019 at 14:21 Comment(3)
How can i know if my app 32 or 64bit after upgraded?Blomquist
you could know that from the generated apk filesLaundrywoman
Just i see a release.apk!Blomquist
Z
1

If you are using react native version less than 0.59 then you must upgrade your apps to react native 0.59 or higher. React native supports 64 bit only from 0.59 version.

Also, make sure your app has following lines in your MyProject/Android/App/Build.gradle file.

splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk true  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }

For more refer: Update your React Native Apps to be 64 Bit

Zebrawood answered 23/6, 2020 at 10:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.