Closed ilyagru closed 11 months ago
We are having this issue as well, except we're on React Native 0.64.3. Only seeing it on Samsung devices on Android 12.
Wondering if https://github.com/software-mansion/react-native-reanimated/issues/3080 is related.
Yes @jarredt it seems occuring only on Samsungs with Android 12. #3080 might be related. It looks like many people who updating their devices to Android 12 and start experience the crash, even in different React Native apps. Any ideas for a workaround?
Nope, spent several days on it and it seemed to be tied to our introduction of reanimated to our app, so we ultimately removed reanimated and went in a different direction.
expo: 45.0.0 react-native: 0.68.2 react-native-reanimated: 2.8.0
I too noticed this issue cropping up amongst Android 12/Samsung devices once we upgraded to Expo SDK 45.
Our app makes use of React Navigation 6 and react-native-reanimated is a dependency so I cannot remove it.
I created a minimal Expo test app to evaluate and it is if in fact the addition of this package that causes it to crash on Android 12/Samsung devices. If I remove it, the crashing stops.
https://github.com/facebook/react-native/issues/33375 appears to be the root issue/cause. Some comments suggest RN 0.69.0 will address but it would be good to have some confirmation from RN devs + react-native-reanimated devs on Samsung devices.
Below is the code I used for my test. Take out reanimated and it should stop crashing on these devices.
{
"name": "expo-demo",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@react-navigation/native": "^6.0.10",
"@react-navigation/stack": "^6.2.1",
"expo": "~45.0.0",
"expo-splash-screen": "~0.15.1",
"expo-status-bar": "~1.3.0",
"expo-updates": "~0.13.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.68.2",
"react-native-reanimated": "~2.8.0"
},
"devDependencies": {
"@babel/core": "^7.12.9"
},
"private": true
}
// App.js
import * as SplashScreen from 'expo-splash-screen';
import React, { useEffect, useState } from 'react';
import RootNavigator from './src/navigation/RootNavigator';
export default function App() {
const [appIsReady, setAppIsReady] = useState(false);
useEffect(() => {
async function initApp () {
try {
await SplashScreen.preventAutoHideAsync();
} catch (e) {
console.log(e);
} finally {
setAppIsReady(true);
}
}
initApp();
}, []);
if (!appIsReady) {
return null;
}
return (
<RootNavigator />
);
}
// RootNavigator.js
import * as SplashScreen from 'expo-splash-screen';
import React, { useEffect, useState } from 'react';
import RootNavigator from './src/navigation/RootNavigator';
export default function App() {
const [appIsReady, setAppIsReady] = useState(false);
useEffect(() => {
async function initApp () {
try {
await SplashScreen.preventAutoHideAsync();
} catch (e) {
console.log(e);
} finally {
setAppIsReady(true);
}
}
initApp();
}, []);
if (!appIsReady) {
return null;
}
return (
<RootNavigator />
);
}
Hi! Any update on this one? RN 0.69.1 hasn't resolved this issue. And since there is a repro, could anyone from maintainers please take a look?
@ilyagru Disappointing to read that 0.69.1 does not address. https://github.com/facebook/react-native/issues/33375 has a lot of activity as of late. I noticed this issue says "1 of 3 tasks" complete. Do all 3 need to complete before maintainers start taking a look?
@webdevmario "1 of 3 tasks" means it is not related to tasks but to the affected platforms, it occurs only on Android, hence 1 checkbox is checked.
@ilyagru Ah, I see. Thank you for clarifying. Definitely just Android. 😫
Hi, just wondering if anyone knows of any movement on this issue? I can see in the thread in the react-native repo there has been a bunch of comments and a repro, but no updates or fixes. This is currently affecting quite a lot of our users, is there anything that could be done in the meantime to prevent this error from happening? Keen to help where possible, but not at all a native developer sadly.
Any updates?
could this be related to #3234? we are experiencing the same issue, it seems like it happens when using predefined animations, in my case is FadeInUp
Having similar issues too, application crashes on android 12, Samsung device, has there been a fix on this?
I also have crash on my release at first time only for Samsung android 12 phone. I need to maintain react-native-reanimated for react-navigation/drawer. So, not fundamental solution,
It could be temporary solution. (In my case, after mounting of navigation's drawer, reset needs to be executed. After a few times of test, I chose 2s)
// MainComponent.js
...
useEffect(() => {
const checkFirst = async () => {
const brand = await getBrand();
const version = await getSystemVersion();
getItemFromAsync('notFirst').then(notFirst => {
if (!notFirst && brand === 'samsung' && version === '12') {
setItemToAsync('notFirst', true);
setTimeout(() => {
RNRestart.Restart();
}, 2000);
}
});
};
checkFirst();
}, []);
...
I solve the issue by changing targetSdkVersion = 31 to argetSdkVersion = 30
maintain react-native-reanimated for react-navigation/drawer. So, not fundamental solution,
How you uploaded the app with targetSdkVersion 30 ? Google play console is asking for target 31 or higher.
right @vjsingh95 if we need to upload the app on the google play console then it must targetSdkVersion = 31.
Did you find a way to fix this issue ? Thanks
I am also experiencing this issue just on samsung devices
Please add below line to build gradle file.
implementation 'androidx.work:work-runtime:2.7.1'
Please add below line to build gradle file.
implementation 'androidx.work:work-runtime:2.7.1'
Thanks, I already try this way, an this error is still throw on Android 12!
Any solution for this? Notifications working when app in foreground but in background not working in targetsdkversion 31.
Any solution for this? Notifications working when app in foreground but in background not working in targetsdkversion 31.
you should add POST_NOTIFICATION permission for targetsdkversion-31 android 13
Did you find a way to fix this issue ? Thanks
Closing since we have limited our support for Reanimated v2 since release of the Reanimated 3, please upgrade
Description
I'm opening an issue here for one which is reported to the React Native team. Could you take a look please? Maybe it is related? I think the react-native-reanimated team might have some fresh ideas on how to resolve it.
Expected behavior
No crash.
Actual behavior & steps to reproduce
To reproduce you need at least:
Crashes as https://github.com/facebook/react-native/issues/33375#issuecomment-1139618328
Please see the whole thread for more logs and info.
Snack or minimal code example
For example, here is a reproduction https://github.com/facebook/react-native/issues/33375#issuecomment-1059844263 https://github.com/jefersonvinicius/react-native-crashing-example
Package versions
This information is also available in the thread.
Affected platforms