React-native: App crashes on starting in Android - SoLoader - base.apk problem

Created on 17 Jul 2018  Â·  23Comments  Â·  Source: facebook/react-native

Environment

Environment:
OS: macOS High Sierra 10.13.5
Node: 9.11.1
Yarn: 1.7.0
npm: 6.1.0
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: 3.1 AI-173.4819257

Packages: (wanted => installed)
react: 16.3.0-alpha.3 => 16.3.0-alpha.3
react-native: 0.54.2 => 0.54.2

Description

The app build successfully in debug and release in android but crashes on starting.

E/AndroidRuntime: FATAL EXCEPTION: Thread-2
Process: com.hys, PID: 23200
java.lang.NoSuchMethodError: No static method loadLibrary(Ljava/lang/String;)V in class Lcom/facebook/soloader/SoLoader; or its super classes (declaration of ‘com.facebook.soloader.SoLoader’ appears in /data/app/com.hys-vH4Q2uE5DrP5sdxI8aPjcA==/base.apk)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:20)
at com.facebook.react.bridge.NativeMap.(NativeMap.java:21)
at com.facebook.react.bridge.JSCJavaScriptExecutorFactory.create(JSCJavaScriptExecutorFactory.java:23)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:921)
at java.lang.Thread.run(Thread.java:764)

Complete stacktrace

--------- beginning of system
07-17 11:25:36.184 1655-31322/system_process I/ActivityManager: Force stopping com.hys appid=10105 user=0: from pid 26681
07-17 11:25:36.198 1882-1882/com.android.phone D/CarrierSvcBindHelper: No carrier app for: 0
07-17 11:25:36.273 1655-4537/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.hys/.MainActivity} from uid 2000
07-17 11:25:36.341 1655-4241/system_process I/ActivityManager: Start proc 26689:com.hys/u0a105 for activity com.hys/.MainActivity
07-17 11:25:36.342 1430-1960/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8298496
07-17 11:25:36.351 26689-26689/? I/zygote: Not late-enabling -Xcheck:jni (already on)
07-17 11:25:36.379 26689-26689/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
07-17 11:25:36.449 2154-2589/com.google.android.googlequicksearchbox:search D/EGL_emulation: eglMakeCurrent: 0xceb3e620: ver 3 0 (tinfo 0xe6528400)
07-17 11:25:36.461 2248-2344/com.google.android.apps.nexuslauncher D/EGL_emulation: eglMakeCurrent: 0xd27149e0: ver 3 0 (tinfo 0xd2716670)
07-17 11:25:36.506 26689-26689/com.hys D/SoLoader: init start
adding system library source: /vendor/lib
07-17 11:25:36.508 26689-26689/com.hys D/SoLoader: adding system library source: /system/lib
07-17 11:25:36.509 26689-26689/com.hys D/SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.hys-_iLposT_b1mZkkXDfAhdyw==/lib/x86 flags = 0]
07-17 11:25:36.515 26689-26689/com.hys D/SoLoader: adding backup source: com.facebook.soloader.ApkSoSource[root = /data/data/com.hys/lib-main flags = 1]
07-17 11:25:36.518 26689-26689/com.hys D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib flags = 2]
07-17 11:25:36.520 26689-26689/com.hys D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /vendor/lib flags = 2]
Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.hys-_iLposT_b1mZkkXDfAhdyw==/lib/x86 flags = 0]
07-17 11:25:36.521 26689-26689/com.hys D/SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.hys/lib-main flags = 1]
07-17 11:25:36.525 26674-26674/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
07-17 11:25:36.531 26689-26689/com.hys V/fb-UnpackingSoSource: locked dso store /data/user/0/com.hys/lib-main
07-17 11:25:36.542 26689-26689/com.hys I/fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.hys/lib-main
07-17 11:25:36.542 26689-26689/com.hys V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.hys/lib-main
07-17 11:25:36.542 26689-26689/com.hys D/SoLoader: init finish: 4 SO sources prepared
07-17 11:25:36.543 26689-26689/com.hys D/SoLoader: init exiting
07-17 11:25:36.583 26689-26689/com.hys D/ReactNative: ReactInstanceManager.ctor()
07-17 11:25:36.584 26689-26689/com.hys D/SoLoader: init exiting
07-17 11:25:36.605 26689-26689/com.hys D/NetworkSecurityConfig: No Network Security Config specified, using platform default
07-17 11:25:36.624 26674-26674/? W/app_process: Unexpected CPU variant for X86 using defaults: x86
07-17 11:25:36.626 26674-26674/? I/app_process: The ClassLoaderContext is a special shared library.
07-17 11:25:36.660 26689-26689/com.hys D/ReactNative: ReactInstanceManager.createReactContextInBackground()
ReactInstanceManager.recreateReactContextInBackgroundInner()
07-17 11:25:36.662 26689-26689/com.hys D/ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer()
07-17 11:25:36.663 26674-26674/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm
07-17 11:25:36.663 26689-26689/com.hys D/ReactNative: ReactInstanceManager.recreateReactContextInBackground()
ReactInstanceManager.runCreateReactContextOnNewThread()
07-17 11:25:36.664 1655-25572/system_process W/WindowManager: Permission Denial: dismissKeyguard from pid=26674, uid=2000 requires android.permission.CONTROL_KEYGUARD
07-17 11:25:36.665 26674-26674/? D/AndroidRuntime: Shutting down VM

--------- beginning of crash

07-17 11:25:36.670 26689-26717/com.hys E/AndroidRuntime: FATAL EXCEPTION: Thread-2
Process: com.hys, PID: 26689
java.lang.NoSuchMethodError: No static method loadLibrary(Ljava/lang/String;)V in class Lcom/facebook/soloader/SoLoader; or its super classes (declaration of 'com.facebook.soloader.SoLoader' appears in /data/app/com.hys-_iLposT_b1mZkkXDfAhdyw==/base.apk)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:20)
at com.facebook.react.bridge.NativeMap.(NativeMap.java:21)
at com.facebook.react.bridge.JSCJavaScriptExecutorFactory.create(JSCJavaScriptExecutorFactory.java:23)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:921)
at java.lang.Thread.run(Thread.java:764)
07-17 11:25:36.677 1655-25572/system_process W/ActivityManager: Force finishing activity com.hys/.MainActivity
07-17 11:25:36.691 26689-26718/com.hys W/unknown:InspectorPackagerConnection: Couldn't connect to packager, will silently retry

Android Locked

Most helpful comment

implementation 'com.facebook.fresco:fresco:1.9.0'
implementation 'com.facebook.fresco:animated-gif:1.9.0'
// IN CASE YOU NEED WEBP SUPPORT / MAKE SURE TO CHANGE THIS TOO TO 1.9.0
implementation 'com.facebook.fresco:animated-webp:1.9.0'
implementation 'com.facebook.fresco:webpsupport:1.9.0'

All 23 comments

I have the same issue! Today happn to me for the first time. Even tried to revert but still getting this.

Even tried to update to latest but still persists.
react: 16.4.1
react-native: 0.56.0

Yo

Happening here too

check this thread out
https://github.com/facebook/SoLoader/issues/13

@Gadigg we already there. Let's see if we get a solution

Same issue here too it started to happen from today.
App crashes on starting with following log.

java.lang.NoSuchMethodError: No static method loadLibrary(Ljava/lang/String;)V in class Lcom/facebook/soloader/SoLoader; or its super classes (declaration of 'com.facebook.soloader.SoLoader' appears in /data/app/mx.com.project-1/base.apk) 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:912) at java.lang.Thread.run(Thread.java:818)

Same with me, anyone have a solution?

Same issue here, am running old build atm in order to continue development

@Convict3d what configuration do you run in order to make it work? What is your react version? React native version?

@Convict3d What are your react and react-native versions? I also tried to downgrade but it did not work.

@ShashijaVirajh and @crisrianonescu I used an android apk I built the day before the problem started, same react-native version of 0.55 and react version of 16.0.0, it was an apk I built 2 days only, I noticed when I rebuilt android it downloaded new versions of facebook.fresco dependencies

I use fresco in my app to display gifs. Are you using this too?

This might be one potential reason.

@Convict3d Is this something related to SDK and BuildTools ?
I am using
"react": "16.3.1",
"react-native": "0.55.3",
compileSdkVersion 26
buildToolsVersion '27.0.3'

Issue is still there.

@cristianonescu yes am using fresco too for some loading animation, its the only thing that changed with gradle output when the app crashed.

Edit: am using gradle 4.4

@cristianonescu @Convict3d Im also using this fresco for animated gif this might be the reason let me remove this and try

@anuruddhadinesh I believe it's caused by fresco, I'll check when am at office

I tried this right now. Still crashes. Nothing changed, I get the same error.

Hi All
I just removed fresco from gradle and tried. Yes it worked. This is the reason for the crash. if you guys can confirm then we can close this bug.

I confirm it is caused by fresco, removed them dependencies from app/build.gradle deleted app/build folder and rebuilt, the app is running fine. I believe we can avoid crashing by identifying a specific version for fresco. Gonna try and report back.

Guys, please try fresco 1.3.0 i am not able to test with it now. I'm on my way to the office.
1.3.0 fresco might be the solution to this

Edited gradle to use fresco dependencies v 1.9.0 and it is working
implementation 'com.facebook.fresco:fresco:1.9.0'
implementation 'com.facebook.fresco:animated-gif:1.9.0'

According to Maven Repository facebook.fresco:fresco and facebook.fresco:animated-gif v 1.10.0 were released 2 days ago, I can confirm it is what causing the issue.

implementation 'com.facebook.fresco:fresco:1.9.0'
implementation 'com.facebook.fresco:animated-gif:1.9.0'
// IN CASE YOU NEED WEBP SUPPORT / MAKE SURE TO CHANGE THIS TOO TO 1.9.0
implementation 'com.facebook.fresco:animated-webp:1.9.0'
implementation 'com.facebook.fresco:webpsupport:1.9.0'

@cristianonescu thanks! it works

thanks @cristianonescu , now works

Was this page helpful?
0 / 5 - 0 ratings