-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android.system.ErrnoException on Android 10 and 11 #74
Comments
I'm experiencing the same issue also on Android version 10 and 11, mostly on Samsung devices, and with SoLoader v0.10.1. Based on the stack trace, it seems it's related to the creation of the FileOutputStream inside the FileLocker class when using the dso_lock file. Here is the stack trace (redacted app name):
|
Experiencing the same exact problem with Andriod 10 and 11. Any new insights on that? it started after upgrading react-native from 0.62 to 0.64.0 |
I still don't know what causes this, but I worked around the issue by using the system loader when SoLoader fails. I started using SoLoader because the system loader was causing crashes on some devices. Using them both seems to have resolved all issues related to loading the native library, or at least I'm no longer getting any crash reports. This code will be slightly different depending on what native library you're trying to load. val useSoLoader = try {
SoLoader.init(this, false)
true
} catch (e: Exception) {
false
}
LibraryLoader.setLibraryLoader(object : LibraryLoader() {
override fun load(name: String?) {
if (useSoLoader) {
try {
SoLoader.loadLibrary(name!!)
} catch (e: Exception) {
System.loadLibrary(name!!)
}
} else {
System.loadLibrary(name!!)
}
}
}) |
Thanks for sharing your workaround @brewin . |
It's a native Android app.
Unless React Native has a way to set the library loader like Mapbox does, you probably can't use this workaround. |
It is becoming a big issue in our application which is in production. Did anyone manage to find a workaround? Is it essential to include soloader for react-native apps? is there an alternative? |
Any help with that will be very much appreciated :) |
I recently upgraded to react-native 0.66 and I started noticing the following launch crash:
It's the most common crash reason on our production app, and I've never experienced it locally. By following the stacktrace it looks like it all starts here: Does anyone have any more insight as to what file that p.s: For us this only seems to be happening on Android 11 (SDK 30). |
Same for me on react-native 0.66 |
This comment may help -- facebook/flipper#2213 (comment) |
This comment has been minimized.
This comment has been minimized.
Interesting @wildseansy! Please let us know here if you get it solved in production! |
This error also happens on Android 12 and I have more than 2k crashes related to this and a lots of bad reviews. Any updates? @wildseansy did it solve? Thanks |
This comment has been minimized.
This comment has been minimized.
Hi guys just an update: The File setWritable solution didn't work for me. With the new soloader 0.10.2 worked on Android 12 but now I'm facing new errors on my phone. |
With soloader 0.10.3 issue is fixed! Nice work! |
That's hopeful to hear. Pushing out a new release of my React Native app with the following // android/app/build.gradle
configurations.all {
resolutionStrategy {
force "com.facebook.soloader:soloader:0.10.3"
}
} |
Gradle force versioning is deprecated link implementation('com.facebook.soloader:soloader:0.10.3') {
version {
strictly '0.10.3'
}
} |
Thanks for letting me know! Will do. |
Pretty sure you can just update your gradle.properties to include
This was helpful for me too, seeing the changes: Thanks for flagging the new release @mym0404 🙏 |
I will close this issue due to 0.10.3 should fix the crash. let me know if it doesn't work. thanks guys. |
Updating // gradle.properties
SO_LOADER_VERSION=0.10.3
// app/build.gradle
configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == 'com.facebook.soloader') {
//https://github.com/facebook/SoLoader/issues/74#issuecomment-961986593
switch (details.requested.name) {
case 'soloader':
details.useVersion SO_LOADER_VERSION
break
}
}
}
}
}
|
Summary: Closes #32325 Closes #32735 There are various crashes related to the SoLoader (example: #32325, #32735, facebook/SoLoader#74, facebook/SoLoader#84) which [seem to get resolved by](#32325 (comment)) upgrading to [v0.10.3](https://github.com/facebook/SoLoader/releases/tag/v0.10.3). The upgrade was already done in [`…/soloader/BUCK`](https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/libraries/soloader/java/com/facebook/soloader/BUCK#L28-L44) (58532ed) but the `SO_LOADER_VERSION` gradle variable was still on v0.10.1. ## Changelog [Android] [Changed] - Bump Soloader to 0.10.3 Pull Request resolved: #32922 Test Plan: This is my very first RN PR and unfortunately I have troubles running the tests. The [proposed tests](https://github.com/facebook/react-native/wiki/Tests) use Buck anyway and the Buck file was already upgraded so those tests wouldn't change presumably. And I can't get the [`rn-tester`](https://github.com/facebook/react-native/tree/main/packages/rn-tester) to run. Reviewed By: christophpurrer Differential Revision: D33664774 Pulled By: ShikaSD fbshipit-source-id: 6be5ddaa688657c1bbb42b3a9892bcf3cb168132
Shouldn't RN update it's own dependency to SO loader? |
@wildseansy in the file where to put this code? I mean in android or in dependency? |
@MuhammadRafeh in your Android |
I'm getting crash reports for an app using SoLoader v0.10.1. The reports are coming from devices running Android 10 and 11. The app is published as an AAB (Android App Bundle), which may or may not be related to the problem. I'm wondering if these exceptions are happening when users try to install the app on an incompatible architecture as described in this comment. So this might not be a bug, but I don't know for sure. All the reports are from new high-end devices like the Galaxy S21, which might indicate that the users are technically savvy enough to sideload APKs.
The text was updated successfully, but these errors were encountered: