Reputation: 141
This started happening after we upgraded our compileSdkVersion and targetSdkVersion to 31.
To give some background: Our project is currently on react native 0.63.2 and previous compileSdkVersion was 30. We were successfully building android app till a few days back but suddenly it started to fail with the following error:
AAPT: error: resource android:attr/lStar not found
After some searching online, we followed some solutions here: Resource linking fails on lStar . We upgraded to compileSdkVersion and targetSdkVersion to 31, did some other related changes and were able to compile successfully. But the app is now crashing immediately on startup when I run it on Android 13 device. The following are the error logs from logcat:
2022-11-06 16:54:44.438 15842-15842/com.flyfinapp E/SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found: needed by /data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64/libjscexecutor.so in namespace classloader-namespace result: 0
2022-11-06 16:54:44.480 15842-15842/com.flyfinapp E/SoLoader: couldn't find DSO to load: libhermes-executor-debug.so caused by: dlopen failed: cannot locate symbol "_ZTVN6hermes2vm12CrashManagerE" referenced by "/data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64/libhermes-executor-debug.so"... result: 0
2022-11-06 16:54:44.482 15842-15842/com.flyfinapp E/SoLoader: couldn't find DSO to load: libhermes-executor-release.so
SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.flyfinapp/lib-main flags = 1]
SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64 flags = 0]
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/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64
result: 0
2022-11-06 16:54:44.483 15842-15842/com.flyfinapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.flyfinapp, PID: 15842
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-release.so
SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.flyfinapp/lib-main flags = 1]
SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64 flags = 0]
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/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64
result: 0
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:30)
at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:19)
at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:23)
at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
at com.flyfinapp.MainApplication.onCreate(MainApplication.java:77)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1266)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6785)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2134)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
2022-11-06 16:54:44.483 15842-15842/com.flyfinapp E/WebEngage: App has crashed
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-release.so
SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.flyfinapp/lib-main flags = 1]
SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64 flags = 0]
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/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64
result: 0
2022-11-06 16:54:47.669 15942-15942/com.flyfinapp E/SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found: needed by /data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64/libjscexecutor.so in namespace classloader-namespace result: 0
2022-11-06 16:54:47.676 15942-15942/com.flyfinapp E/SoLoader: couldn't find DSO to load: libhermes-executor-debug.so caused by: dlopen failed: cannot locate symbol "_ZTVN6hermes2vm12CrashManagerE" referenced by "/data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64/libhermes-executor-debug.so"... result: 0
2022-11-06 16:54:47.678 15942-15942/com.flyfinapp E/SoLoader: couldn't find DSO to load: libhermes-executor-release.so
SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.flyfinapp/lib-main flags = 1]
SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64 flags = 0]
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/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64
result: 0
2022-11-06 16:54:47.679 15942-15942/com.flyfinapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.flyfinapp, PID: 15942
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-release.so
SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.flyfinapp/lib-main flags = 1]
SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64 flags = 0]
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/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64
result: 0
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:30)
at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:19)
at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:23)
at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
at com.flyfinapp.MainApplication.onCreate(MainApplication.java:77)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1266)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6785)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2134)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
2022-11-06 16:54:47.679 15942-15942/com.flyfinapp E/WebEngage: App has crashed
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-release.so
SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.flyfinapp/lib-main flags = 1]
SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64 flags = 0]
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/~~xPxviTwL84s3LS8L8OTgAA==/com.flyfinapp-EZ0vekCsB5BzvVwFLbm-GQ==/lib/arm64
result: 0
We have enableHermes
set to true.
We also searched solutions for this but everything was applicable for RN 67 and beyond. But we are still on RN 63, so none of those solutions worked. We can try upgrading our RN version but there are some blockers so it is not possible to upgrade right away. For now we would like to solve this specific issue and move on. Any help here would be greatly appreciated.
Upvotes: 14
Views: 12277
Reputation: 11
for me the solution is by deleting this line from package.json
"main": "node_modules/expo/AppEntry.js",
Upvotes: 1
Reputation: 11
This worked for me.
npm uninstall react-native-reanimated
npm install [email protected]
npx react-native start --reset-cache
Upvotes: 1
Reputation: 1298
SOLVED
This issue took my good chunk of the day. But I tested almost all the solutions proposed.
But ultimately, the solutions provided here worked!
Upvotes: 0
Reputation: 77
As far as I understand, this issue is occuring due to incompatibility between the react-native
and the hermes-engine
version. Make sure that you are using the proper hermes version for [email protected]
Upvotes: 0
Reputation: 1587
Removing flipper completely solved the issue:
Upvotes: 0
Reputation: 3442
After upgrading to React Native 0.69
, replace the following lines in app/build.gradle
:
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
With:
implementation("com.facebook.react:hermes-engine:+") {
exclude group:'com.facebook.fbjni'
}
On React Native 0.69, users will be consuming the Android multi-variant artifacts available inside the
android/com/facebook/react/hermes-engine/
folder in thereact-native
NPM package: https://reactnative.dev/architecture/bundled-hermes#android-users.
Upvotes: 4
Reputation: 5
I was able to sort out exactly the same problem by setting proper values for hermesFlagsForVariant
and deleteDebugFilesForVariant
in your build.gradle. Make sure you specify the values that match your build variant name (e.g. beta
, qa
etc) https://github.com/facebook/react-native/issues/33177#issuecomment-1066604107. However, I'm using RN0.70.5, so not sure if it'd help in older versions
Upvotes: 0
Reputation: 1285
The only thing that worked for me was disabling Hermes in app/build.gradle
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
]
Upvotes: 3
Reputation: 878
It seems related to a broken release on Maven.
Here is the conversation about it: https://github.com/facebook/react-native/issues/35210
@Ankur's comment is the suggested workaround for RN >= 0.63
Upvotes: 0
Reputation: 1308
I recommend using fixed stable version of react native library if you are not using one, like below:
def REACT_NATIVE_VERSION = "0.64.2" //replace this with the latest stable version you were using before
allprojects {
configurations.all {
resolutionStrategy {
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
repositories {
google()
...
}
}
Optionally, you may consider using dynamic value of REACT_NATIVE_VERSION
from your package.json
file with the following script:
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())
This will prevent your app from unexpected behaviours due to unstable versions, however, downside of this is you have to check for latest updates from react native library manually and update time to time.
Upvotes: 3