02/26 15:01:23: Launching app
$ adb install-multiple -r -t /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/dep/dependencies.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_6.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_0.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_5.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_1.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_2.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_3.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_4.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_9.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_7.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/split-apk/debug/slices/slice_8.apk /Users/gabe/pm/react-native/rx/fresh/android/app/build/intermediates/instant-run-apk/debug/app-debug.apk
Split APKs installed in 3 s 839 ms
$ adb shell am start -n "com.fresh/com.fresh.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 25916 on device sony-e6853-CB5A2BF4PC
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer()
D/ReactNative: ReactInstanceManager.recreateReactContextInBackground()
ReactInstanceManager.runCreateReactContextOnNewThread()
D/SoLoader: About to load: libreactnativejni.so
libreactnativejni.so found on /data/data/com.fresh/lib-main
D/SoLoader: Loading lib dependencies: [libglog_init.so, libyoga.so, libprivatedata.so, libfb.so, libfolly_json.so, libjsc.so, libglog.so, libgnustl_shared.so, libandroid.so, liblog.so, libstdc++.so, libm.so, libc.so, libdl.so]
About to load: libglog_init.so
libglog_init.so found on /data/data/com.fresh/lib-main
D/SoLoader: Loading lib dependencies: [libglog.so, libgnustl_shared.so, liblog.so, libstdc++.so, libm.so, libc.so, libdl.so]
About to load: libglog.so
libglog.so found on /data/data/com.fresh/lib-main
D/SoLoader: Loading lib dependencies: [libgnustl_shared.so, libstdc++.so, libm.so, libc.so, libdl.so]
About to load: libgnustl_shared.so
libgnustl_shared.so found on /data/data/com.fresh/lib-main
D/SoLoader: Loading lib dependencies: [libm.so, libc.so, libdl.so]
About to load: libm.so
libm.so not found on /data/data/com.fresh/lib-main
D/SoLoader: libm.so not found on /data/app/com.fresh-1/lib/arm64
libm.so not found on /system/vendor/lib
libm.so found on /system/lib
libm.so loaded implicitly
Loaded: libm.so
About to load: libc.so
libc.so not found on /data/data/com.fresh/lib-main
libc.so not found on /data/app/com.fresh-1/lib/arm64
libc.so not found on /system/vendor/lib
libc.so found on /system/lib
libc.so loaded implicitly
Loaded: libc.so
D/SoLoader: About to load: libdl.so
libdl.so not found on /data/data/com.fresh/lib-main
libdl.so not found on /data/app/com.fresh-1/lib/arm64
libdl.so not found on /system/vendor/lib
libdl.so found on /system/lib
libdl.so loaded implicitly
Loaded: libdl.so
E/SoLoader: Error when loading lib: dlopen failed: "/data/data/com.fresh/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit lib hash: 38a149cf3f94c06f35444ea1c5280541 search path is /data/app/com.fresh-1/lib/arm64
couldn't find DSO to load: libgnustl_shared.so caused by: dlopen failed: "/data/data/com.fresh/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit
couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libgnustl_shared.so caused by: dlopen failed: "/data/data/com.fresh/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit
couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libgnustl_shared.so caused by: dlopen failed: "/data/data/com.fresh/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit
couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libgnustl_shared.so caused by: dlopen failed: "/data/data/com.fresh/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit
E/AndroidRuntime: FATAL EXCEPTION: Thread-4
Process: com.fresh, PID: 25916
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libgnustl_shared.so caused by: dlopen failed: "/data/data/com.fresh/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:703)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:564)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:500)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:455)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:18)
at com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:19)
at com.facebook.react.bridge.JSCJavaScriptExecutorFactory.create(JSCJavaScriptExecutorFactory.java:21)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:917)
at java.lang.Thread.run(Thread.java:761)
Application terminated.
Suggested fix allows the app to run on a physical Android device
@liorJuice , thank you very much for your fix!
After applying your fix, I managed to run an app freshly created with create-rx-app
on physical Android device, LGE LG-H815 (Android 6.0, API 23).
Now that you have pointed out this setting, I just checked that the ./android/app/build.gradle for every reactxp's sample project, and indeed the abiFilters "armeabi-v7a", "x86"
is in every one of them:
build.gradle of ImageList sample
build.gradle of RXPTest sample
build.gradle of TodoList sample
build.gradle of hello-world sample
build.gradle of hello-world-js sample
Effects of abiFilters "armeabi-v7a", "x86"
I am trying to understand the effects of abiFilters "armeabi-v7a", "x86"
. On NdkOptions - Android Plugin 3.3.0 DSL Reference
When this flag is not configured, Gradle builds and packages all available ABIs.
Seems like the omitted ABIs in abiFilters "armeabi-v7a", "x86"
, are:
armeabi
This ABI was removed in NDK r17. Though React Native apps may target ... Android 4.1 (API 16) or newer, so I would just need to add <uses-sdk android:minSdkVersion="17" />
to the ./android/app/src/main/AndroidManifest.xml to make omitting "armeabi" safe, right? Any other settings to do?
arm64-v8a
armeabi-v7a libraries should also run on processors with arm64-v8a instruction set. So it should be safe to omit "arm64-v8a" for now.
x86_64
This is the 64-bits version of x86 instruction set. The 32 bits x86 libraries should also run on 64 bits processors. So it should be safe to omit "x86_64" for now.
I am very new to all these. Please feel free to correct me if I misunderstood anything.
64-bits version of apps required on the Google Play store from August 2019
On Android Developers Blog: Improving app security and performance on Google Play for years to come, it is announced that:
In August 2019, Play will require that new apps and app updates with native libraries provide 64-bit versions in addition to their 32-bit versions.
So does that mean that we have to add "x86_64", "arm64-v8a" by August 2019? Will that causes any problem then?
I tried including either "x86_64" or "arm64-v8a" to the abiFilters, then run react-native run-android
:
"x86_64" - The app builds and runs on the physical Android device successfully.
"arm64-v8a" - The app crashes upon launch as detailed in the main description of this issue.
Does this mean that we would not be able to publish any new apps or updates from August 2019 onwards?
Is this problem occurring with reactxp?
An app freshly created with react-native init
does not have abiFilters "armeabi-v7a", "x86"
in its ./android/app/build.gradle file. It includes all available ABIs and will still run successfully on the same physical Android device.
Is this problem caused by using reactxp? Any chance that all necessary 64 bits libraries can be provided?
Side note: "x86-64", instead of "x86_64", is written
"x86-64", instead of "x86_64", is written in ./android/app/build.gradle in an app freshly created by create-rx-app
, at two locations:
In android > splits > abi > include
In the nested function in android > applicationVariants.all
I am not sure if "x86-64" is a valid value, or it should be "x86_64".
I do not have an Intel-based Android device to test if the app can actually run on 64 bits x86 processor.
Is there any plan to release the 64 bits libraries to meet Google's Play store requirement?
In August 2019, Play will require that new apps and app updates with native libraries provide 64-bit versions in addition to their 32-bit versions.
Using RN 0.60.5 version.
If you guys are wondering why your app crashes if you download it from playstore, make the below changes
packagingOptions {
exclude '/lib/arm64-v8a/libc++_shared.so' (exclude '/lib/arm64-v8a/error_causing_library.so')
exclude '/lib/x86_64/libc++_shared.so' (exclude '/lib/arm64-v8a/error_causing_library.so')
//In pickFirst, replace the library name with the library that is causing error.
pickFirst '/lib/x86/libc++_shared.so' (pickFirst '/lib/x86/error_causing_library.so')
pickFirst '/lib/armeabi-v7a/libc++_shared.so' (pickFirst '/lib/armeabi-v7a/error_causing_library.so')
If you do not know which library is causing the crash, upload your bundle in Firebase test lab and then check. It will tell you which library is throwing the error