react-native: after upgrade 0.66.4 -> 0.69.1 build was success but it crash when startup app...

New Version

0.69.1

Old Version

0.66.4

Build Target(s)

android

Output of react-native info

System: OS: Windows 10 10.0.19044 CPU: (8) x64 Intel® Core™ i7-9700 CPU @ 3.00GHz Memory: 7.68 GB / 31.94 GB Binaries: Node: 14.18.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD npm: 7.6.3 - ~\AppData\Roaming\npm\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: AI-212.5712.43.2112.8609683 Visual Studio: Not Found Languages: Java: 11.0.8 - /c/Program Files/Common Files/Oracle/Java/javapath/javac npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: 0.69.1 => 0.69.1 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Issue and Reproduction Steps

just startup app, it craash by logcat here java.lang.UnsatisfiedLinkError: couldn’t find DSO to load: libjscexecutor.so caused by: couldn’t find DSO to load: libjsc.so

i saw upgrade helper, and I have modified all the files

but i cant escape this crash…

I’m using productFlavors, could this be a problem?

flavorDimensions “mode” productFlavors { dev { dimension “mode” } prod { dimension “mode” } staging { dimension “mode” } }

About this issue

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

Most upvoted comments

I found that RN v0.69.4 seems to solve the above problem @rdtf1230

I was having the same problem.

  • react v18.10.0

  • react-native v0.70.3

  • com.android.tools.build:gradle:7.0.4

There was a problema in react-native-gradle-plugin that was fixed, but react-native@0.70+ uses version 0.70.3.

That solved it for me:

package.json

  {
  .....
  "resolutions": {
    "react-native-gradle-plugin": "0.71.4"
  },
  "dependencies": {
    "react-native-gradle-plugin": "0.71.4"
      .....
  }

react-native+0.70.3.patch

diff --git a/node_modules/react-native/react.gradle b/node_modules/react-native/react.gradle
index 912a407..d182708 100644
--- a/node_modules/react-native/react.gradle
+++ b/node_modules/react-native/react.gradle
@@ -386,8 +386,8 @@ afterEvaluate {
                     // Workaround for Android Gradle Plugin 3.4+ new asset directory
                     into ("merged_assets/${variant.name}/out")
 
-                    // Workaround for Android Gradle Plugin 7.1 asset directory
-                    into("$buildDir/intermediates/assets/${variant.name}/merge${targetName}Assets")
+                    // Workaround for Android Gradle Plugin 7.3 asset directory
+                    into("$buildDir/intermediates/assets/${variant.name}")
                 }
             }
 

I found that RN v0.69.4 seems to solve the above problem @rdtf1230

Thank you so much for posting the answer.

I updated to 0.69.4 after seeing this answer, but the same error kept coming up, I’ve tried many things and it seems to have finally been fixed Now let’s introduce the method

Edit app/build.gradle file

Previously my file was

  1. apply plugin
  2. apply from … n. project.ext.react

After trying various things, I moved ‘project.ext.react’ to the top line.

like this

  1. project.ext.react
  2. apply plugin ~~
  3. apply from

When I run the app, I see that the libso error no longer appears, and the problem seems to have been resolved.

I hope this article is helpful to people who have had the same type of problem.

I was having the same problem.

  • react v18.10.0
  • react-native v0.70.3
  • com.android.tools.build:gradle:7.0.4

There was a problema in react-native-gradle-plugin that was fixed, but react-native@0.70+ uses version 0.70.3.

That solved it for me:

package.json

  {
  .....
  "resolutions": {
    "react-native-gradle-plugin": "0.71.4"
  },
  "dependencies": {
    "react-native-gradle-plugin": "0.71.4"
      .....
  }

react-native+0.70.3.patch

diff --git a/node_modules/react-native/react.gradle b/node_modules/react-native/react.gradle
index 912a407..d182708 100644
--- a/node_modules/react-native/react.gradle
+++ b/node_modules/react-native/react.gradle
@@ -386,8 +386,8 @@ afterEvaluate {
                     // Workaround for Android Gradle Plugin 3.4+ new asset directory
                     into ("merged_assets/${variant.name}/out")
 
-                    // Workaround for Android Gradle Plugin 7.1 asset directory
-                    into("$buildDir/intermediates/assets/${variant.name}/merge${targetName}Assets")
+                    // Workaround for Android Gradle Plugin 7.3 asset directory
+                    into("$buildDir/intermediates/assets/${variant.name}")
                 }
             }
 

Thanks for this! This helped me realize what caused my production crashes on RN 0.70. I bumped my gradle plugin to 7.3.1 and didn’t realize that would be a breaking change. Downgrading gradle to the version in the RN template (7.2.1) fixed the runtime crash for me.