facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.14k stars 24.32k forks source link

SoLoader: couldn't find DSO to load: libjscexecutor.so #35222

Closed Brittognanaraj closed 1 year ago

Brittognanaraj commented 2 years ago

Description

In debug build also getting crashing while start up. So kindly helps me to fix this issue. I have given the stack trace and error below

The below code I tried and getting crash while start my app in debug too. I have given the config below

project level build.gradle

buildscript { ext { buildToolsVersion = "33.0.0" minSdkVersion = 24 compileSdkVersion = 33 targetSdkVersion = 33 ndkVersion = "20.1.5948944" supportLibVersion = "33.0.0" } repositories { google() mavenCentral()

    jcenter()
    flatDir {
        dirs 'libs'
    }
}
dependencies {
    classpath("com.android.tools.build:gradle:4.1.3")
    classpath 'com.google.gms:google-services:4.3.10'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
    classpath 'com.dipien:bye-bye-jetifier:1.2.1'
}

}

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects { configurations.all { resolutionStrategy { force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION } } repositories { mavenLocal() jcenter()

    google()
    flatDir {
        dirs 'libs'
    }
    maven {   url "https://maven.google.com"  }
   maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url("$rootDir/../node_modules/react-native/android")
    }
    maven {
        // Android JSC is installed from npm
        url("$rootDir/../node_modules/jsc-android/dist")

    }
    mavenCentral()
    maven { url 'https://www.jitpack.io' }
    maven {
        url "$rootDir/../node_modules/detox/Detox-android"
    }
    maven {
        url 'https://sdk.withpersona.com/android/releases'
    }

}

}

And app/build.gradle

project.ext.react = [ enableHermes: true, // clean and rebuild if changing bundleInBeta: true, devDisabledInBeta: true, hermesFlagsForVariant: { def v -> v.name.toLowerCase().contains('release') || v.name.toLowerCase().contains('debug') ? ['-w'] : [] }, deleteDebugFilesForVariant: { def v -> v.name.toLowerCase().contains('release') || v.name.toLowerCase().contains('debug') }, ]

flavorDimensions "swellApp"
productFlavors {

    qa {

        signingConfig signingConfigs.qaConfig
        buildConfigField "boolean", "QA", "true"

    }

    prod{

        signingConfig signingConfigs.prodConfig
        buildConfigField "boolean", "QA", "false"

}

}

dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:" +REACT_NATIVE_VERSION // From node_modules implementation 'com.android.support:multidex:1.0.3' implementation 'com.facebook.soloader:soloader:0.10.4' implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" implementation "org.webkit:android-jsc:+" debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { exclude group:'com.facebook.fbjni' } implementation 'com.google.firebase:firebase-storage:20.0.0' implementation project(':react-native-secure-key-store') debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.facebook.flipper' exclude group:'com.squareup.okhttp3', module:'okhttp' }

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.facebook.flipper'
}

if (enableHermes) {
    implementation("com.facebook.react:hermes-engine:+") {
        exclude group:'com.facebook.fbjni'
             }

} else {
    implementation jscFlavor
}
androidTestImplementation('com.wix:detox:+')
implementation ("androidx.appcompat:appcompat:1.3.1") {
    version {
        strictly '1.3.1'
    }
}

}

FYI: I am using product flavor

Version

0.68.3

Output of npx react-native info

System: OS: macOS 12.2.1 CPU: (10) arm64 Apple M1 Max Memory: 105.72 MB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 18.11.0 - /opt/homebrew/bin/node Yarn: 1.22.18 - /opt/homebrew/bin/yarn npm: 8.19.2 - /opt/homebrew/bin/npm Watchman: 2022.10.17.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 23, 29, 30, 31, 32, 33 Build Tools: 29.0.2, 29.0.3, 30.0.2, 30.0.3, 32.0.0, 32.1.0, 33.0.0 System Images: android-24 | Google APIs ARM 64 v8a, android-25 | Google APIs ARM 64 v8a, android-28 | Google APIs ARM 64 v8a, android-28 | Google ARM64-V8a Play ARM 64 v8a, android-29 | ARM 64 v8a, android-29 | Google Play ARM 64 v8a, android-30 | ARM 64 v8a, android-30 | Intel x86 Atom_64, android-30 | Google APIs ARM 64 v8a, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64, android-30 | Google Play ARM 64 v8a, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64, android-31 | ARM 64 v8a, android-31 | Intel x86 Atom_64, android-31 | Google APIs ARM 64 v8a, android-31 | Google APIs Intel x86 Atom_64, android-31 | Google Play ARM 64 v8a, android-31 | Google Play Intel x86 Atom_64, android-32 | Google APIs ARM 64 v8a, android-32 | Google APIs Intel x86 Atom_64, android-32 | Google Play ARM 64 v8a, android-32 | Google Play Intel x86 Atom_64, android-33 | Google APIs ARM 64 v8a, android-Tiramisu | Google Play ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 13.3/13E113 - /usr/bin/xcodebuild Languages: Java: 11.0.8 - /Library/Java/JavaVirtualMachines/openlogic-openjdk-11.jdk/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.3 => 0.68.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Getting below error

/SoLoader: couldn't find DSO to load: libjscexecutor.so SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 flags = 0] SoSource 1: com.facebook.soloader.DirectApkSoSource[root = (/data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/base.apk!/lib/arm64-v8a, )] SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2] SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2] Native lib dir: /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 result: 0

V/SoLoader: libhermes-executor-debug.so not found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 2022-11-06 22:32:59.211 4616-4616/com.swellmoney.qa.android V/SoLoader: libhermes-executor-debug.so not found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/base.apk!/lib/arm64-v8a 2022-11-06 22:32:59.211 4616-4616/com.swellmoney.qa.android V/SoLoader: libhermes-executor-debug.so not found on /system/lib64 2022-11-06 22:32:59.211 4616-4616/com.swellmoney.qa.android V/SoLoader: libhermes-executor-debug.so not found on /vendor/lib64 2022-11-06 22:32:59.211 4616-4616/com.swellmoney.qa.android E/SoLoader: couldn't find DSO to load: libhermes-executor-debug.so SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 flags = 0] SoSource 1: com.facebook.soloader.DirectApkSoSource[root = (/data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/base.apk!/lib/arm64-v8a, )] SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2] SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2] Native lib dir: /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 result: 0 2022-11-06 22:32:59.212 4616-4616/com.swellmoney.qa.android V/SoLoader: libhermes-executor-release.so not found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 2022-11-06 22:32:59.237 4616-4616/com.swellmoney.qa.android D/SoLoader: libhermes-executor-release.so found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/base.apk!/lib/arm64-v8a 2022-11-06 22:32:59.262 4616-4661/com.swellmoney.qa.android I/FA: Tag Manager is not found and thus will not be used 2022-11-06 22:32:59.306 4616-4669/com.swellmoney.qa.android V/SoLoader: libfbjni.so not found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 2022-11-06 22:32:59.308 4616-4669/com.swellmoney.qa.android V/SoLoader: libandroid.so not found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 2022-11-06 22:32:59.308 4616-4669/com.swellmoney.qa.android V/SoLoader: libandroid.so not found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/base.apk!/lib/arm64-v8a 2022-11-06 22:32:59.308 4616-4669/com.swellmoney.qa.android D/SoLoader: libandroid.so found on /system/lib64 2022-11-06 22:32:59.308 4616-4669/com.swellmoney.qa.android D/SoLoader: libandroid.so loaded implicitly 2022-11-06 22:32:59.309 4616-4669/com.swellmoney.qa.android D/SoLoader: libfbjni.so found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/base.apk!/lib/arm64-v8a 2022-11-06 22:32:59.309 4616-4669/com.swellmoney.qa.android V/SoLoader: libflipper.so not found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 2022-11-06 22:32:59.329 4616-4669/com.swellmoney.qa.android D/SoLoader: libflipper.so found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/base.apk!/lib/arm64-v8a 2022-11-06 22:32:59.338 4616-4616/com.swellmoney.qa.android W/oney.qa.androi: Accessing hidden field Landroid/view/View;->mKeyedTags:Landroid/util/SparseArray; (greylist, reflection, allowed) 2022-11-06 22:32:59.338 4616-4616/com.swellmoney.qa.android W/oney.qa.androi: Accessing hidden field Landroid/view/View;->mListenerInfo:Landroid/view/View$ListenerInfo; (greylist, reflection, allowed) 2022-11-06 22:32:59.339 4616-4616/com.swellmoney.qa.android W/oney.qa.androi: Accessing hidden field Landroid/view/View$ListenerInfo;->mOnClickListener:Landroid/view/View$OnClickListener; (greylist, reflection, allowed) 2022-11-06 22:32:59.341 4616-4616/com.swellmoney.qa.android I/flipper: flipper: FlipperClient::addPlugin Inspector 2022-11-06 22:32:59.341 4616-4616/com.swellmoney.qa.android I/flipper: flipper: FlipperClient::addPlugin React 2022-11-06 22:32:59.342 4616-4616/com.swellmoney.qa.android I/flipper: flipper: FlipperClient::addPlugin Databases 2022-11-06 22:32:59.343 4616-4616/com.swellmoney.qa.android I/flipper: flipper: FlipperClient::addPlugin Preferences 2022-11-06 22:32:59.343 4616-4616/com.swellmoney.qa.android I/flipper: flipper: FlipperClient::addPlugin CrashReporter 2022-11-06 22:32:59.344 4616-4616/com.swellmoney.qa.android I/flipper: flipper: FlipperClient::addPlugin Network 2022-11-06 22:32:59.444 4616-4616/com.swellmoney.qa.android W/oney.qa.androi: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) 2022-11-06 22:32:59.445 4616-4616/com.swellmoney.qa.android W/oney.qa.androi: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) 2022-11-06 22:32:59.474 4616-4616/com.swellmoney.qa.android W/unknown:ReactNative: Packager connection already open, nooping. 2022-11-06 22:32:59.491 4616-4616/com.swellmoney.qa.android I/Gralloc4: mapper 4.x is not supported 2022-11-06 22:32:59.492 4616-4616/com.swellmoney.qa.android D/HostConnection: createUnique: call 2022-11-06 22:32:59.493 4616-4616/com.swellmoney.qa.android D/HostConnection: HostConnection::get() New Host Connection established 0xb400007d74b57c10, tid 4616 2022-11-06 22:32:59.494 4616-4616/com.swellmoney.qa.android D/goldfish-address-space: allocate: Ask for block of size 0x100 2022-11-06 22:32:59.494 4616-4616/com.swellmoney.qa.android D/goldfish-address-space: allocate: ioctl allocate returned offset 0x1f3ff8000 size 0x8000 2022-11-06 22:32:59.496 4616-4616/com.swellmoney.qa.android D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 2022-11-06 22:33:00.520 4616-4671/com.swellmoney.qa.android V/SoLoader: libreactnativejni.so not found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/lib/arm64 2022-11-06 22:33:00.530 4616-4671/com.swellmoney.qa.android D/SoLoader: libreactnativejni.so found on /data/app/~~3WAuHN29DqEedaWn79kThw==/com.swellmoney.qa.android-L5-GoM0RqkZ0AsNEYMyIxg==/base.apk!/lib/arm64-v8a 2022-11-06 22:33:01.169 4616-4694/com.swellmoney.qa.android W/oney.qa.androi: Accessing hidden method Landroid/os/WorkSource;->add(I)Z (greylist,test-api, reflection, allowed) 2022-11-06 22:33:01.169 4616-4694/com.swellmoney.qa.android W/oney.qa.androi: Accessing hidden method Landroid/os/WorkSource;->add(ILjava/lang/String;)Z (greylist,test-api, reflection, allowed) 2022-11-06 22:33:01.169 4616-4694/com.swellmoney.qa.android W/oney.qa.androi: Accessing hidden method Landroid/os/WorkSource;->get(I)I (greylist, reflection, allowed) 2022-11-06 22:33:01.169 4616-4694/com.swellmoney.qa.android W/oney.qa.androi: Accessing hidden method Landroid/os/WorkSource;->getName(I)Ljava/lang/String; (greylist, reflection, allowed) 2022-11-06 22:33:02.406 4616-4616/com.swellmoney.qa.android D/InstallReferrerState: OK 2022-11-06 22:33:02.545 4616-4703/com.swellmoney.qa.android A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7200726f727255 in tid 4703 (mqt_js), pid 4616 (oney.qa.android)

Steps to reproduce

While open an app itself facing this error

Snack, code example, screenshot, or link to a repository

https://stackoverflow.com/questions/74338076/soloader-couldnt-find-dso-to-load-libjscexecutor-so

YBeletsky117 commented 2 years ago

Same problem... :(

ugurdalkiran commented 2 years ago

I don't have any problem in developer mode but when I generate a signed apk I get the following problem.

SoLoader: libjscexecutor.so not found on /data/data/com.a0704/lib-main
SoLoader: libjscexecutor.so found on /data/app/~~HzUCfnl_ctpfVqiici6PqA==/com.a0704-nw-A-VoveEX98v94uI8ZOQ==/lib/x86
SoLoader: Not resolving dependencies for libjscexecutor.so
System.err: java.lang.UnsatisfiedLinkError: dlopen failed: library "libjsc.so" not found: needed by /data/app/~~HzUCfnl_ctpfVqiici6PqA==/com.a0704-nw-A-VoveEX98v94uI8ZOQ==/lib/x86/libjscexecutor.so in namespace classloader-namespace
YBeletsky117 commented 2 years ago

I tried adding the following to my app/build.gradle

At the beginning of the file I declared

def useIntlJsc = false

And then entered in the dependencies

dependencies {
    ...
    if (useIntlJsc) {
        implementation 'org.webkit:android-jsc-intl:+'
    } else {
        implementation 'org.webkit:android-jsc:+'
    }
    ...
}

Try it, maybe it will help!

ncs-ankur commented 2 years ago

This solution worked for me: https://stackoverflow.com/a/74341863/17168314

Basically, we can use static stable version of RN library.

SaidKherif commented 2 years ago

We got this issue in our team. We suspect Hermes to not be compatible with Hermes.

You can try to delete flipper integration in your Android folder.

For us we got this error on Android 5 ( On debug mode ) but not on other version. And we have hermes enabled. So we deleted Flipper and now it's running good. I hope it help :)

ugurdalkiran commented 2 years ago

How do I delete Flipper?

SaidKherif commented 2 years ago

Maybe i missed something. Try fo find all occurence of "flipper" and delete it

liudakehpu commented 2 years ago

This solution worked for me: https://stackoverflow.com/a/74341863/17168314

Basically, we can use static stable version of RN library.

Thank you, you save my day , it useful

1zeno commented 1 year ago

Update react native version from 0.68.5 to 0.70.5 and delete Flipper from Android works here

cortinico commented 1 year ago

Closing as a byproduct of #35210

bozaigao commented 1 year ago

Run ./gradlew clean then build again

Hieunguyen198 commented 11 months ago

For react-native 0.63.4 @/build.gradle :

configurations.all { resolutionStrategy { force "com.facebook.react:react-native:0.63.4" } }

@app/build.gradle:

//implementation "com.facebook.react:react-native:+" // From node_modules implementation ("com.facebook.react:react-native") version { strictly "0.63.4" }

Hope it's help you.