-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
Native C++ crashes on Android 9 on React Native 0.59 #105
Comments
I was about to integrate this to react-navigation, but it seems we will have to wait. |
@IagorM, perhaps you could do some testing? There may be some other factors at play here |
I will give a try so. |
@joshjhargreaves, this issue here shows that RN 59.5+ deprecates ReactFragmentActivity, and this library depends on that to work properly. |
@IagorM any update on the issue? |
@IagorM @kmagiera Using |
@palexs I gave up trying to use it the way it is right now, will wait for a more stable version and compatible with RN 60+ |
I'm seeing the same issue in a fair number of crash reports within the Google Play dashboard. All seem to be isolated to Android 9.0 as well. |
I'm experiencing this issue on my Android 9.0 device as well, which is running RN 0.59.8 via Expo v34. Crash dump:
I would really love to use this library, but I'm not sure what to do now that these crashes are apparent. |
I think I'm seeing the same crash: This started to happen after an upgrade to react-native-screens and react-navigation stack (from 1.x to 2.x) backtrace: |
Same crash on Android 9:
"dependencies": {
"@expo/vector-icons": "~10.0.0",
"@react-native-community/masked-view": "0.1.5",
"@react-navigation/bottom-tabs": "^5.0.0",
"@react-navigation/native": "^5.0.0",
"@react-navigation/stack": "^5.0.0",
"@react-navigation/web": "~1.0.0-alpha.9",
"expo": "~36.0.0",
"expo-asset": "~8.0.0",
"expo-constants": "~8.0.0",
"expo-font": "~8.0.0",
"expo-web-browser": "~8.0.0",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
"react-native-gesture-handler": "~1.5.0",
"react-native-safe-area-context": "0.6.0",
"react-native-screens": "2.0.0-alpha.12",
"react-native-web": "~0.11.7",
"react-native-webview": "7.4.3"
}, After remove this in App.js, crash stop: import { enableScreens } from 'react-native-screens'
enableScreens() |
Does the issue still exist in the newest versions of library? And if so, can you provide a repo with minimal configuration needed to reproduce the issue? |
I'm definitely still seeing crashes, but much less often than before. |
We recently added:
And noticed some users were getting this issue. We were able to replicate this using the following stack: AppStack:
Reproducable flow:
Relevant library versions:
Full Crashlytics issue:
|
@SMJ93 can you provide a repo/snack with minimal configuration needed to reproduce the issue? It would be very useful for solving the issue. |
It seems that the crash is related to the |
Hi, can you set Btw, you may have to make sure that you didn't set |
@thanakij it works, but you probably do not want to have the WebView with hardware acceleration enabled all the time. The bug happens when transitioning between screens because Android sets the screen's layer to hardware for the duration of the transition and
I am not sure if it is enough though. |
I could not agree more. Your solution is much cleaner. Do you have a chance to test this in production with Crashlytics?
|
If someone from the thread could apply this setup in the app to test if this solution works, it would be great. @SMJ93 could you check if subscribing to navigation events resolves the issue? |
Hey @WoLewicki, thank you for taking a look and sorry for the delayed response - I've been very busy the last few weeks. It looks like adding the navigation events as you suggested above has fixed the issue! I've tested in both debug and with a release APK and everything looks good 👍 We used a WebView wrapper so it applies to all of our WebViews:
Thanks again! |
Hey @SMJ93, thank you for your help, do you think it's possible to have a similar wrapper on react-native-navigation ? |
hey @manuhook, I haven't use react-native-navigation for while, but if they have transition listeners similar to react-navigation it should be possible |
Closing this since #607 is merged. Comment here please if the crash appears after that commit and applying workaround for |
We are still getting this crash, and while |
Can you provide a test example in TestsExample project (https://github.com/software-mansion/react-native-screens/tree/master/TestsExample) with minimal configuration needed to reproduce the issue? It would be very helpful in debugging the problem. |
Just to add some additional info, I don't think it's related to react-native-webview inherently. I'm getting similar crashes that seem to be caused by a webview created by a banner ad from @react-native-firebase/admob. This means we can't disable hardware acceleration for the webview. Switching to a normal stack navigator from the native one fixes it as well, but adjusting the height of the banner also causes a crash, so it might be an issue with the native android webview code. |
@Un3qual There was an issue with android webview (https://www.bbc.com/news/technology-56496783) that caused different applications, gmail and facebook, to crash on Android. The issue was fixed on latest update (released Mar 22nd, 2021). |
still facing this error on 2022
|
The issue is still present for us. Any ways to fix it? Unfortunately we have ads in our app which use the WebView and we have no direct control over them :( |
I made a repro in react-native-webview/react-native-webview#2771 for an identical crash that does not use I'm not sure where this problem lies but it would be great for someone with deeper experience in Android development to take a look. I believe that adding |
We recently upgraded our app from React Native
0.56
to0.59
and started seeing crashes when navigating between screens on a test device Pixel 3 running Android 9 - we can also reproduce on a Pixel 3 emulator.The cashes themselves are very consistent and happen often. Disabling
useScreens
on Android stops the crashes from happening. I will work on trying to create a repro project but for now all I have is the stacktrack which I apologize for in advance as I realize how unhelpful that is but thought there might be some value in opening an issue to give some visibility in case it is a general issue and not something tied to the specifics of our app setup.The crash itself is happening in
libhwui.so
The text was updated successfully, but these errors were encountered: