facebook / react-native

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

Error :couldn't find DSO to load: libjscexecutor.so, while upgrading react-native version from 0.70.1 to 0.71.0 #46299

Closed Shah-Rajan closed 1 month ago

Shah-Rajan commented 2 months ago

Description

@shergin, @sammy-SC @javache @cortinico @fkgozali

while upgrading react-native version 0.70.1 to 0.71.0 the build is successfull but on launch app crashes with the error :couldn't find DSO to load: libjscexecutor.so

android/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { ext { buildToolsVersion = "34.0.0" minSdkVersion = 23 compileSdkVersion = 34 targetSdkVersion = 34 kotlin_version = '1.7.20'

   // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
    ndkVersion = "23.1.7779620"
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    // classpath("com.android.tools.build:gradle:7.2.1")
    // classpath 'com.android.tools.build:gradle:7.0.0'
    classpath('com.android.tools.build:gradle:7.4.2')
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath 'com.google.gms:google-services:4.3.14'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { // exclusiveContent { // // We get React Native's Android binaries exclusively through npm, // // from a local Maven repo inside node_modules/react-native/. // // (The use of exclusiveContent prevents looking elsewhere like Maven Central // // and potentially getting a wrong version.) // filter { // includeGroup "com.facebook.react" // } // forRepository { // maven { // url "$rootDir/../node_modules/react-native/android" // } // } // } // 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 { // // We don't want to fetch react-native from Maven Central as there are // // older versions over there. // content { // excludeGroup "com.facebook.react" // } // } // google() // maven { url 'https://www.jitpack.io' } configurations.all { resolutionStrategy { force "com.google.android.gms:play-services-location:21.0.1" } } } }

app/build.gradle apply plugin: "com.android.application" apply plugin: "com.facebook.react" apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' project.ext.envConfigFiles = [ development: ".env.development", staging: ".env.staging", production: ".env.production", ] apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

import com.android.build.OutputFile // import org.apache.tools.ant.taskdefs.condition.Os

/**

// project.ext.react = [ // enableHermes: true, // clean and rebuild if changing // ]

// apply from: "../../node_modules/react-native-code-push/android/codepush.gradle" react { / Folders / // The root of your project, i.e. where "package.json" lives. Default is '..' // root = file("../") // The folder where the react-native NPM package is. Default is ../node_modules/react-native // reactNativeDir = file("../node-modules/react-native") // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen // codegenDir = file("../node-modules/react-native-codegen") // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js // cliFile = file("../node_modules/react-native/cli.js")

/* Variants */
//   The list of variants to that are debuggable. For those we're going to
//   skip the bundling of the JS bundle and the assets. By default is just 'debug'.
//   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]

/* Bundling */
//   A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
//   The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
//   The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
//   The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
//   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
//   A list of extra flags to pass to the 'bundle' commands.
//   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []

/* Hermes Commands */
//   The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
//   The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

} /**

/**

/**

/**

def reactNativeArchitectures() { def value = project.getProperties().get("reactNativeArchitectures") return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] }

apply from: "../../node_modules/@sentry/react-native/sentry.gradle" android { ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion
namespace "com.hawak"
packagingOptions {
    pickFirst 'lib/x86/libc++_shared.so'
    pickFirst 'lib/x86_64/libjsc.so'
    pickFirst 'lib/arm64-v8a/libjsc.so'
    pickFirst 'lib/arm64-v8a/libc++_shared.so'
    pickFirst 'lib/x86_64/libc++_shared.so'
    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}

defaultConfig {

    applicationId "com.hawak"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    // versionCode generateVersionCode()
    // versionName generateVersionName()
    versionCode 610010060
    versionName "4.2.2"
    // buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
    flavorDimensions "default"
    resValue "string", "build_config_package", "com.hawak"
    resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis())

}

productFlavors {
    production {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
    }
    staging {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
    }
    development {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
    }
}

splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include (*reactNativeArchitectures())
    }
}
signingConfigs {
    debug {
        storeFile file('debug.keystore')
        storePassword 'android'
        keyAlias 'androiddebugkey'
        keyPassword 'android'
    }
    release {
        if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
            storeFile file(MYAPP_UPLOAD_STORE_FILE)
            storePassword MYAPP_UPLOAD_STORE_PASSWORD
            keyAlias MYAPP_UPLOAD_KEY_ALIAS
            keyPassword MYAPP_UPLOAD_KEY_PASSWORD
        }
    }
}
buildTypes {
    debug {
        signingConfig signingConfigs.debug
    }
    release {
        firebaseCrashlytics {
            nativeSymbolUploadEnabled true
            unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
        }
        // Caution! In production, you need to generate your own keystore file.
        // see https://reactnative.dev/docs/signed-apk-android.
        signingConfig signingConfigs.release
        // minifyEnabled enableProguardInReleaseBuilds
        shrinkResources false
        minifyEnabled false
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}

// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
    variant.outputs.each { output ->
        // For each separate APK per architecture, set a unique version code as described here:
        // https://developer.android.com/studio/build/configure-apk-splits.html
        // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
        def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
        def abi = output.getFilter(OutputFile.ABI)
        if (abi != null) {  // null for the universal-debug, universal-release variants
            output.versionCodeOverride =
                    defaultConfig.versionCode * 1000 + versionCodes.get(abi)
        }

    }
}

}

dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android")

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")

implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.squareup.okhttp3', module:'okhttp'
}

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

if (hermesEnabled.toBoolean()) {
    implementation("com.facebook.react:hermes-android")
} else {
    implementation jscFlavor
}

}

// Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.implementation into 'libs' }

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

/**

/**

Steps to reproduce

xyz

React Native Version

0.71.0

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx react-native info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M2
    Memory: 60.22 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    Yarn: Not Found
    npm: 8.19.4 - ~/Desktop/Projects/hawak-sales-app-0.71.0/node_modules/.bin/npm
    Watchman: 2024.01.15.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.14.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2
    Android SDK:
      API Levels: 29, 30, 31, 33, 34
      Build Tools: 30.0.3, 31.0.0, 33.0.0, 33.0.1, 34.0.0
      System Images: android-33 | Google APIs ARM 64 v8a, android-33 | Google Play ARM 64 v8a, android-34 | Google APIs ARM 64 v8a, android-34 | Google Play ARM 64 v8a, android-TiramisuPrivacySandbox | Google Play ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2023.1 AI-231.9392.1.2311.11255304
    Xcode: 15.2/15C500b - /usr/bin/xcodebuild
  Languages:
    Java: 17.0.10 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.0 => 0.71.0

Stacktrace or Logs

couldn't find DSO to load: libjscexecutor.so
                                                                                                        SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.hawak/lib-main flags = 1]
                                                                                                        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: /lib/arm64
                                                                                                     result: 0

Reproducer

dadsfff

Screenshots and Videos

No response

react-native-bot commented 2 months ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 2 months ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
react-native-bot commented 2 months ago
:warning: Unsupported Version of React Native
:information_source: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
react-native-bot commented 2 months ago
:warning: Unsupported Version of React Native
:information_source: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
cipolleschi commented 2 months ago

@Shah-Rajan Thanks for the report.

  1. please don't ping people in the issue directly. We look at all of them and we will get to yours when we have time.
  2. Both 0.70 and 0.71 are not supported anymore. We don't have capacity to look into bugs from those versions.
  3. Can you find a way to isolate and reproduce the problem using this template? We can't help you without it.

Thanks for your understanding.

cortinico commented 1 month ago

please don't ping people in the issue directly. We look at all of them and we will get to yours when we have time. Both 0.70 and 0.71 are not supported anymore. We don't have capacity to look into bugs from those versions.

Closing for the aformentioned reasons. Please don't ping random users to attract attention + 0.70/0.71 are unsupported.