react-native: Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.asda.android/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit

We are using ReactNative in our app. App is crashing with Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: “/data/data/com.asda.android/lib-main/libgnustl_shared.so” is 32-bit instead of 64-bit only on Sony-Xperia device(Xperia XA/Android 7). Its not happening on other devices we have removed the 64 bit versions of api from apk by adding following things in build.gradle

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.2'

    flavorDimensions "default"

    …….

   defaultConfig {  
        ...  
        ndk {  
            abiFilters "armeabi-v7a", "x86"  
        } 
    }

    packagingOptions {
    ……
        exclude '/lib/mips64/**'
        exclude '/lib/arm64-v8a/**'
        exclude '/lib/x86_64/**'
    }

    …….
}

Environment

Scanning folders for symlinks in /Users/vn0zpn2/ern_workspace/asda-ern-miniapps/DMTMiniApp/node_modules (5ms)

Environment: OS: macOS Sierra 10.12.6 Node: 9.3.0 Yarn: 1.3.2 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: Not Found

Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.51.0 => 0.51.0

Its happening in production. We are using the Litho along with React native(version: 0.51.0) build.gradle

Steps to Reproduce

App Launch.

Expected Behavior

Should not crash on app launch

Actual Behavior

Crashes with log below

Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.asda.android/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit
       at java.lang.Runtime.load0(Runtime.java:897)
       at java.lang.System.load(System.java:1505)
       at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:71)
       at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:42)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:299)
       at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:65)
       at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:42)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:299)
       at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:65)
       at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:42)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:299)
       at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:65)
       at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:42)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:299)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:247)
       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$4.run(ReactInstanceManager.java:928)
       at java.lang.Thread.run(Thread.java:761)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 26 (4 by maintainers)

Most upvoted comments

defaultConfig { ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' packagingOptions { exclude '/lib/mips64/**' exclude '/lib/arm64-v8a/**' } }

this worked for me

Wow, ran into this just now and can’t believe this was closed just 17 hours ago with no resolution.

yes it worked.

just once, then failed again. sad!

what is the error?

Doesn’t work anymore on Playstore 😢

what is exact issue? is it uploading apk or running?

It’s running alright, but Playstore won’t accept it because of the 64 bit issue.