react-native
react-native copied to clipboard
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(R) Core(TM) 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" } }
I've battled that error before on an earlier version of RN. I don't recall the solution right now, but google is your friend with this one. If it comes back to me, I'll post it.
I've battled that error before on an earlier version of RN. I don't recall the solution right now, but google is your friend with this one. If it comes back to me, I'll post it.
oh plz help me ;)
@nschild Any recollection?
@rdtf1230 Maybe related to this?
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so caused by: couldn't find DSO to load: libjsc.so
This might be a valid bug, but in order to investigate this we need:
- To know what's the version of Gradle & Android Gradle Plugin you're using
- Someone to try out of a release build on a fresh React Native 0.69.1 project
If the latter is turning out to crash with the same stacktrace, that it's a bug that we need to fix.
@rdtf1230아마도 이것과 관련 이 있습니까? it didnt work for me.... logcat just said 'java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so caused by: couldn't find DSO to load: libjsc.so'
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so caused by: couldn't find DSO to load: libjsc.so
This might be a valid bug, but in order to investigate this we need:
- To know what's the version of Gradle & Android Gradle Plugin you're using
- Someone to try out of a release build on a fresh React Native 0.69.1 project
If the latter is turning out to crash with the same stacktrace, that it's a bug that we need to fix.
here is my gradle android/build.gradle - classpath("com.android.tools.build:gradle:7.1.1") android/gradle/wrapper/gradle-wrapper.properties - https://services.gradle.org/distributions/gradle-7.3.3-all.zip
and its all belongs to upgrade helper 0.66.4 -> 0.69.1
@rdtf1230 any solutions? This problem has been bothering me for a long time.
@rdtf1230 any solutions? This problem has been bothering me for a long time.
Unfortunately so am I.... Probably I won't upgrade until I find a workaround
I am also experiencing same problem. When I checked the crash log from the installed apk on a physical device I got the following report:
FATAL EXCEPTION: create_react_context
java.lang.RuntimeException: Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
- react v18.0.0
- react-native v0.69.3
- com.android.tools.build:gradle:7.0.4
Is there any work around or fix for this?
@cortinico
I am also experiencing same problem. When I checked the crash log from the installed apk on a physical device I got the following report:
FATAL EXCEPTION: create_react_context java.lang.RuntimeException: Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
* react v18.0.0 * react-native v0.69.3 * com.android.tools.build:gradle:7.0.4
Is there any work around or fix for this?
So i was able to get my project to install and run properly on a physical device by doing the following;
- installed RN v0.69.2
- com.android.tools.build:gradle:7.1.1
- reset metro cache
- cleaned build
- then created a new signed apk release.
Hope this helps.
I am also experiencing same problem. When I checked the crash log from the installed apk on a physical device I got the following report:
FATAL EXCEPTION: create_react_context java.lang.RuntimeException: Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
* react v18.0.0 * react-native v0.69.3 * com.android.tools.build:gradle:7.0.4
Is there any work around or fix for this?
So i was able to get my project to install and run properly on a physical device by doing the following;
- installed RN v0.69.2
- com.android.tools.build:gradle:7.1.1
- reset metro cache
- cleaned build
- then created a new signed apk release.
Hope this helps.
it didnt work for me ;) anyway thank you...
Sorry about that, but are you updating the version of an exisiting RN project or starting a new one ? @rdtf1230
죄송합니다. 기존 RN 프로젝트의 버전을 업데이트하거나 새 프로젝트를 시작하시겠습니까?@rdtf1230
Someday i will try ;) Create a new project with 0.69.1 and Move files from an existing from 0.66.4 project
I'm asking because it's something I've never done before. Do other developers usually solve problems like this?? Wonder if i try to step into wrong side...
죄송합니다. 기존 RN 프로젝트의 버전을 업데이트하거나 새 프로젝트를 시작하시겠습니까?@rdtf1230
Someday i will try ;) Create a new project with 0.69.1 and Move files from an existing from 0.66.4 project
I'm asking because it's something I've never done before. Do other developers usually solve problems like this?? Wonder if i try to step into wrong side...
In RN doc, there is a guide that show how to safely upgrade RN versions. either using RN-CLI or manually. you could check it out.
https://reactnative.dev/docs/upgrading
When I create a project using the latest RN version, it works fine for me. But when I config the build variants, it crash on any android simulator.
When I create a project using the latest RN version, it works fine for me. But when I config the build variants, it crash on any android simulator.
i think so too... the problem is build variants, Is there no solution?
Someone to try out of a release build on a fresh React Native 0.69.1 project
Can someone try to create a reproducer? It would help us investigate what's the root cause of this issue.
:warning: | Missing Reproducible Example |
---|---|
:information_source: | It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner. |
Coming back to this as I had a coworker with a similar issue. Have you tried opening your project in Android Studio then file > sync project files with gradle.
I found that RN v0.69.4 seems to solve the above problem @rdtf1230
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
- apply plugin
- apply from ... n. project.ext.react
After trying various things, I moved 'project.ext.react' to the top line.
like this
- project.ext.react
- apply plugin ~~
- 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 [email protected]+ 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 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 [email protected]+ 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.
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.
As @aniravi24 mentioned, RN 0.70 builds with AGP 7.2.1 Diverging from the AGP version is not recommended and will most likely cause crashes.
Specifically @cleandersonlobo I see you are on RN 0.70 with AGP 7.0.4. This is not supported. Doing a patch-package of react-native and using "react-native-gradle-plugin": "0.71.4" is not recommended and will result in further update issues in the future.
I'm also closing here as the reproducer I asked was never provided and I suppose the issue was related to a wrong AGP version.
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 [email protected]+ 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.
it worked for me! 7.2.1 version fixed it