-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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] SoLoader error using App Bundle #23764
Comments
Can you sync config files with RN0.58 Android template https://github.com/facebook/react-native/tree/0.58-stable/local-cli/templates/HelloWorld/android and try again? EDIT: And update to latest RN 0.58.6 please. |
@radeno I have synced all config files to 0.58 except BUCK. Although it's hard to copy it as it is since our app is brownfield. Pretty sure there is no native changes from 0.58.4 to 0.58.6. @RoJoHub Do you mean that the |
Also you should create directory of For your question, please confirm what architecture your device is. |
@vanydeasy i understand your concerns. You can diff files with for example VSCode (Compare file). Or if you upgraded from lower version check it with https://github.com/react-native-community/rn-diff-purge. I just want to as much as possible to have identical configs, to eliminate diffs. It sometimes really helps to find problematic issue. But i think i have found your issue. |
@RoJoHub from this doc, i got that @radeno yes we use https://github.com/react-native-community/rn-diff-purge as well to upgrade our app. Do you want me to list down every possible difference based on it? |
@vanydeasy you are right. SoLoader was backported. My mistake. |
I think we should browse this page. Specially. Automatic extraction of native code at install timeWhen installing an application, the package manager service scans the APK, and looks for any shared libraries of the form:
If none is found, and you have defined a secondary ABI, the service scans for shared libraries of the form:
When it finds the libraries that it's looking for, the package manager copies them to /lib/lib.so, under the application's data directory (data/data/<package_name>/lib/). If there is no shared-object file at all, the application builds and installs, but crashes at runtime. |
If you update android,maybe system will not search again.Unless reinstall |
I had the same issue with AGP 3.3.2. For now, we are downgrading to AGP 3.2.0 until bump RN to 0.59 |
@vanydeasy could you please check CPU architecture of devices crashing. It seems that x86_64 is missing from abiFilters, and that might causing issues on x86_64 architecture. |
also could you please check if it still persists on 0.59.x? |
Is this something that could be fixed by: 4b996da? Would be good to know whether this issue persists on 0.59.1 where this commit is included. |
@RoJoHub You are probably right but doesn't that mean that the fault is on android side then? @miguelslemos SoLoader v0.6.0 was backported to RN v0.58.4 which we are using. The problem still persists. @dulmandakh x86_64 just got included on 0.59, right? So I don't think that's the case. It even crashes on Samsung s10 which uses ARM architecture. But I'm going to update you after I upgrade to 0.59. @grabbou Don't think that's the case since x86_64 is not even included on RN 0.58. @OllyDixon Oh really? I'm using gradle plugin 3.3.2 now. What version of RN are you using btw? |
It's just a temple. |
In you gradle android {
...
defaultConfig {
...
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a"
}
}
}
Some device will run on I have already said it before. Why don't you try it. |
@RoJoHub many of us use deployment pipelines and don't have access to directories. Also this is a hack not a fix and for any other team members on the project they need to be aware of this on each build. |
In a reply, I chose the wrong people.Sorry. @OllyDixon I did not say to add This image is just to express the results after the file is added. I correct my answer. |
In addition, according to my experience, your solution is not related to her problem. I think this is not a react-native issue, and this issue should be closed. |
@RoJoHub I'm confused. We do not even include |
Use adbUse Java Code/**
* The name of the instruction set (CPU type + ABI convention) of native code.
* @deprecated Use {@link #SUPPORTED_ABIS} instead.
*/
String cpuInfo = android.os.Build.CPU_ABI;
|
I had the same issue while using Android bundle with RN 0.59.0. Some devices work and other don't and I didn't find the key differences. It seems I have fixed it by removing the override of the versionCode for each variants in - // 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:
- // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
- 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 =
- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
- }
- }
- } The Android doc says it is no longer require when using bundle (I don't have enough knowledge of Android's internal to understand why it was require in the first place). Note: I don't have any I am not 100% sure of the fix yet as I only tested locally on 1 device with an APK extracted from my bundle with bundletool. I will confirm the fix latter after deploying the APKs on enough devices through Google Play console. |
@vanydeasy after more than one day of debugging I still haven't figure it out in which conditions the bug is triggered (my "fix" above is definitively not working) :-[ In my case it seems very random; in most cases it crash but sometimes after a re-install, the App works fine until a re-start and then it keep crashing. I will try to find more time later this week to investigate the differences between the working and non-working APKs. |
This fixed the issue for me in RN 0.62.2:
|
I have same issue it coming after clear caches and reinstall it happend |
Dublicate issue this command work for me That should probably fix this. |
@tapz is correct. Just do what he suggested. |
In my case, the error does not appear on 0.61.5 anymore. Should I close this? |
|
This is not fixed for us. I would not close this issue. v 0.62.2 Fails on an emulator installed with API 30 and API 28 with several errors all following the same format. Strangely, it runs on API 29. This might be a clue. It seems the targeted emulator plays a role.
The issue referenced on the SoLoader repo perfectly describes the problem -- but., since SoLoader, ships with react-native this seems like a ReactNative problem too. |
I have got same issue: |
I also have this issue, are there any temporary workarounds? I don't mind editing some node modules manually :) |
I am getting: with
|
|
@fabriciodanioj do you know why that worked? I'm having the same issue with the following specs:
|
@jimmyceroneii sorry. I dont know. |
@fabriciodanioj I just tried it out and it kind of worked for me. The crashing is gone (yay!) but now it is refusing to connect with my development server. I don't know if the two are connected, but I'm guessing no. Anyway, thanks for your help! |
Same, it's crashing on emulator installed with API 30. How did you fix this issue? |
This seems like the most promising solution to the problem: facebook/SoLoader#59 (comment)
|
Any solution? still facing the same issue. |
try this one |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
🐛 Bug Report
Please help!
There are some crashes happening in android using app bundle but I am not sure how to reproduce it. It happens on our app with daily crash of 200 users.
The errors have multiple variations that occur on various android versions.
To Reproduce
We have tried to reproduce it with many devices but we can only reproduce it in one condition.
If we reinstall the app afterwards, it works fine.
Although, we are still unsure whether it is the only error case.
Expected Behavior
The app does not crash on any device.
Code Example
Environment
The text was updated successfully, but these errors were encountered: