react-native: SoLoaderDSONotFoundError on Android 11 Emulator

Description

Image

Steps to reproduce

  1. run app

React Native Version

0.77.0

Affected Platforms

Runtime - Android

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: Linux 5.15 Arch Linux
  CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
  Memory: 20.56 GB / 35.24 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.4.0
    path: /usr/sbin/node
  Yarn:
    version: 1.22.22
    path: /usr/sbin/yarn
  npm:
    version: 10.9.0
    path: /usr/sbin/npm
  Watchman:
    version: 20240414.112832.0
    path: /usr/sbin/watchman
SDKs:
  Android SDK:
    API Levels:
      - "30"
      - "31"
      - "33"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
      - 35.0.0
    System Images:
      - android-33 | Google APIs Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: AI-242.23339.11.2421.12700392
Languages:
  Java:
    version: 21.0.5
    path: /usr/sbin/javac
  Ruby:
    version: 3.0.6
    path: /usr/sbin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.0
    wanted: 0.77.0
npmGlobalPackages:
  "*react-native*": Not Found

Stacktrace or Logs

com.facebook.soloader.SoLoaderDSONotFoundError: couldn't find DSO to load: libreactnative.so
	existing SO sources: 
		SoSource 0: ApplicationSoSource[DirectorySoSource[root = /data/app/~~J3QOoNee1T1kJAI_G8H9MA==/REDACTED-zSqcWE8VxRCwSbqgF10NmQ==/lib/arm flags = 0]]
		SoSource 1: DirectApkSoSource[root = [/data/app/~~J3QOoNee1T1kJAI_G8H9MA==/REDACTED-zSqcWE8VxRCwSbqgF10NmQ==/base.apk!/lib/x86]]
		SoSource 2: DirectorySoSource[root = /vendor/lib flags = 3]
		SoSource 3: DirectorySoSource[root = /system/lib flags = 3]
	Native lib dir: /data/app/~~J3QOoNee1T1kJAI_G8H9MA==/REDACTED-zSqcWE8VxRCwSbqgF10NmQ==/lib/arm

    at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1216)
    at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:1078)
    at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:943)
    at com.facebook.soloader.SoLoader.loadLibraryOnAndroid(SoLoader.java:859)
    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:842)
    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:812)
    at com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsCxxInterop.<clinit>(ReactNativeFeatureFlagsCxxInterop.kt:28)
    at com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsCxxInterop.override(ReactNativeFeatureFlagsCxxInterop.kt)
    at com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsCxxAccessor.override(ReactNativeFeatureFlagsCxxAccessor.kt:475)
    at com.facebook.react.internal.featureflags.ReactNativeFeatureFlags.override(ReactNativeFeatureFlags.kt:316)
    at com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load(DefaultNewArchitectureEntryPoint.kt:42)
    at com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load$default(DefaultNewArchitectureEntryPoint.kt:29)
    at REDACTED.MainApplication.onCreate(MainApplication.kt:53)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
    at android.app.ActivityThread.access$1300(ActivityThread.java:237)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7656)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Reproducer

I don’t have a reproducer that I can share (yet)

Screenshots and Videos

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 30 (3 by maintainers)

Most upvoted comments

I’m experiencing the same issue, crashes on Google Nexus 5X (Android 13) reported via Firebase Crashlytics, but no crashes are visible in the Play Console.

Environment:

{
  "react-native": "0.76.9"
}

android/build.gradle

buildscript {
    ext {
        buildToolsVersion = "35.0.0"
        minSdkVersion = 24
        compileSdkVersion = 35
        targetSdkVersion = 34
        kotlinVersion = "1.9.25"
        ndkVersion = "26.1.10909125"
    }
}

android/gradle.properties

org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
android.useAndroidX=true
android.enablePngCrunchInReleaseBuilds=true
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
newArchEnabled=true
hermesEnabled=true
expo.gif.enabled=true
expo.webp.enabled=true
expo.webp.animated=false
EX_DEV_CLIENT_NETWORK_INSPECTOR=true
expo.useLegacyPackaging=false
android.extraMavenRepos=[]

It still happens with real users. We’ve released new version of the app after increasing RN to 0.78.2 and enabling new arch. So far, with the help of Crashlytics, one user using Nexus 5X and Android 13 is impacted with the following returned: Fatal Exception: com.facebook.soloader.SoLoaderDSONotFoundError

Can it be reopened and investigated? @cortinico

Same problem here, seems to only happen on Nexus phones (Nexus 5X and Pixel 6 Pro) We are using react native 0.76.9 with the new architecture enabled

aforementioned Nexus 5X (somehow with Android 13)

I guess it’s simply an emulator that google uses for testing the app

Ohhh wait! Could it be I was installing the APK I generated after excluding x86 arch from building…

Closing as this is most likely the reason, as also confirmed by @RohovDmytro

I am also getting the same issue with only two devices Nexus 5X (Android 13) and Pixel 6 Pro (Android 12). I am using react native v0.76.1 with new architecture enabled in Android.

with our latest release with react native 0.79.4 we are seeing this issue with a Pixel 6 Pro with Android 12 as well.

we have react native 0.79.4 with new arch and users on the aforementioned Nexus 5X (somehow with Android 13) and a OnePlus 8 pro with android 11. Unfortunately since we have none of the devices we can also not reproduce the issue

We’re also on 0.76.9 and just started experiencing this issue with new architecture enabled.

Any current thoughts?

We have encountered the same issue on our app, also Nexus 5X device, also Android 13. Looks oddly contained to that particular device?

Can it be reopened and investigated?

Do you have a repro? If yes -> open a new issue and we can look into it

Ohhh wait! Could it be I was installing the APK I generated after excluding x86 arch from building…

I’ll check and update this issue soon.

Sent from Proton Mail Android

-------- Original Message -------- On 2/4/25 9:36 PM, Nicola Corti wrote:

com.facebook.soloader.SoLoaderDSONotFoundError: couldn’t find DSO to load: libreactnative.so

Message is self explanatory: the app can’t find libreactnative.so to load. If it has been removed from the APK for any reason, we can’t load React Native as that contains the C++ code.

How does your application onCreate method looks like?

Is it something like?

override

fun

onCreate

() {

super

.onCreate()

SoLoader

.

init

(

this

,

OpenSourceMergedSoMapping

)

if

(

BuildConfig

.

IS_NEW_ARCHITECTURE_ENABLED

) {

//

If you opted-in for the New Architecture, we load the native entry point for this app.

load() } }

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

@react-native-bot I’ll add a reproducer maybe soon, let me sleep for today 😭