-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
UIViewControllerHierarchyInconsistency #944
Comments
Can you provide a snack/snippet with minimal configuration needed to reproduce the issue? I am afraid we cannot do anything without it since the logs are not descriptive. |
I am also having this issue. In my case it is Modal within stackNavigator being dismissed. Workaround for me was postpone dismissing to next JS Thread tick with |
I am also having this issue on iOS, seemingly randomly but also quite often, due to a modal being closed. The set timeout method mentioned above did not work. It is a fatal error. My error message in XCode is |
Temporary workaround has seemed to be using the react-native-modal package as the same problems do not arise and it offers the same functionality as React Native core Modal component. Doesn't fix the problem at hand though |
@chrisozgo99 can you provide a reproduction of the issue so we can work on it? One reason for the crash I can think of is due to the logic of |
I am also having this issue on iOS, the app crashes when I set "Dashboard" as the initialRoute, but works find with "Menu" as the initialRoute. Using enableScreens(false) does solve the issue, but sounds like that's not an ideal workaround. RN 0.64.2, react 17.0.1, react-native-screens 3.4.0, react-navigation 4.4.4, XCode 12.4.
|
@rcase100 can you provide an example in a form of a repo so we can work on it? It is hard to get any information from such a snippet unfortunately. |
I'll try to. I have some private libraries in there so will need to remove
them first.
…On Tue, Jul 6, 2021 at 9:46 AM Wojciech Lewicki ***@***.***> wrote:
@rcase100 <https://github.com/rcase100> can you provide an example in a
form of a repo so we can work on it? It is hard to get any information from
such a snippet unfortunately.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#944 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALSRN3VUWETVMNODNGYLZQDTWMJKTANCNFSM45DPWHHQ>
.
|
I am closing it due to no response in more than 30 days. Please provide a reproduction and then we can reopen it. |
Here is video of this issue: Simulator.Screen.Recording.-.iPhone.13.Pro.-.2021-11-12.at.17.47.01.mp4Here is repo for reproduction of this issue: https://github.com/pt7892/UIViewControllerHierarchyInconsistency-repro Steps to reproduce:
Issue is not consistent, but trying couple of times steps from above should trigger this bug Crash log:
@WoLewicki can we reopen this? |
@pt7892 +1 also getting the same issue, issue is not consistent but coming |
I debugged it and it seems like there is a race condition between const CrashScreen: FC = () => {
const [showModal, setShowModal] = useState(false);
useEffect(() => {
setTimeout(() => {
setShowModal(true);
}, 0);
}, []);
return (
<View style={styles.container}>
<Text>Crash screen</Text>
<Modal visible={showModal}>
<View style={styles.container}>
<Text>Loading</Text>
</View>
</Modal>
</View>
);
}; Can you check if it resolves the issue? |
Yes, this those resolve the issue, but i guess this is not optimal solution as this could lead to situations where you can see layout, which should be hidden, for a glitch of a second before Modal pops out, plus every time you use Modal you would need to check if this issue could happen and implement this fix. Isn't there anything that can be done to fix this in different way? |
I think the easiest solution is using either |
@chrisozgo99 - that library extends react-native modal, so curious why it would fix the issue? Do you have any ideas? |
Getting this same issue.. Can we reopen? |
@SethArchambault doesn't this solve the issue: #944 (comment) ? |
@WoLewicki I'll try it - so does this mean anytime we set the visibility of a modal we need to do it in a setTimeout? Feels like a bit of a hack right? |
I think it is only needed if you open a screen with the modal shown from the beginning since then |
Ahha got it, thanks! |
@WoLewicki we are opening multiple modals at the same time and our app crashes on iOS, do you have any recommendations for this scenario? |
@arron-olio do you mean |
@WoLewicki Thank you for your response, yes we are currently just using the |
I think you can switch only this one stack, but since |
Hey, I think this issue is likely on the react-native library itself. When I patch it with this code, it will not crash any more. This will solve what @WoLewicki mentioned is the race condition. I will create a PR on the react-native and seek for their opinion Here is my repo https://github.com/wood1986/react-native-modal-crash. Its implementation is based on @pt7892 but I use the latest dependencies for If you revert my last commit wood1986/react-native-modal-crash@86e7bc1 (after revert or hard reset, you need to rerun |
…g modal (#35705) Summary: `react-native-screens` has a bug about `UIViewControllerHierarchyInconsistency` when dismissing a `react-native` `<Modal>`. Here is the bug software-mansion/react-native-screens#944 After adding `dispatch_async` block, it solves the issue. But I do not know if this is right. Here is the example repo https://github.com/wood1986/react-native-modal-crash You can revert my last commit wood1986/react-native-modal-crash@86e7bc1 to reproduce the issue ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] - fixed the potential race condition when dismissing and presentating modal Pull Request resolved: #35705 Reviewed By: cipolleschi Differential Revision: D42253488 Pulled By: makovkastar fbshipit-source-id: 3e98fa9e719ecdeddeb2a367b0cd364e15136d56
Hey guys, react-native took my patch. Can you guys try again? |
I think we should ask people who reported on this issue if applying the fix from @wood1986 fixes their crashes, cc @yberstad @chrisozgo99 @rcase100 @pt7892 @hussainsherwani @SethArchambault @arron-olio. |
Great! What version of react-native is this in? |
It is not in any release yet. They plan to include it in 0.70.1 |
🙏 |
…g modal (#35705) Summary: `react-native-screens` has a bug about `UIViewControllerHierarchyInconsistency` when dismissing a `react-native` `<Modal>`. Here is the bug software-mansion/react-native-screens#944 After adding `dispatch_async` block, it solves the issue. But I do not know if this is right. Here is the example repo https://github.com/wood1986/react-native-modal-crash You can revert my last commit wood1986/react-native-modal-crash@86e7bc1 to reproduce the issue ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] - fixed the potential race condition when dismissing and presentating modal Pull Request resolved: #35705 Reviewed By: cipolleschi Differential Revision: D42253488 Pulled By: makovkastar fbshipit-source-id: 3e98fa9e719ecdeddeb2a367b0cd364e15136d56
…g modal (#35705) Summary: `react-native-screens` has a bug about `UIViewControllerHierarchyInconsistency` when dismissing a `react-native` `<Modal>`. Here is the bug software-mansion/react-native-screens#944 After adding `dispatch_async` block, it solves the issue. But I do not know if this is right. Here is the example repo https://github.com/wood1986/react-native-modal-crash You can revert my last commit wood1986/react-native-modal-crash@86e7bc1 to reproduce the issue ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] - fixed the potential race condition when dismissing and presentating modal Pull Request resolved: #35705 Reviewed By: cipolleschi Differential Revision: D42253488 Pulled By: makovkastar fbshipit-source-id: 3e98fa9e719ecdeddeb2a367b0cd364e15136d56
…g modal (facebook#35705) Summary: `react-native-screens` has a bug about `UIViewControllerHierarchyInconsistency` when dismissing a `react-native` `<Modal>`. Here is the bug software-mansion/react-native-screens#944 After adding `dispatch_async` block, it solves the issue. But I do not know if this is right. Here is the example repo https://github.com/wood1986/react-native-modal-crash You can revert my last commit wood1986/react-native-modal-crash@86e7bc1 to reproduce the issue ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] - fixed the potential race condition when dismissing and presentating modal Pull Request resolved: facebook#35705 Reviewed By: cipolleschi Differential Revision: D42253488 Pulled By: makovkastar fbshipit-source-id: 3e98fa9e719ecdeddeb2a367b0cd364e15136d56
Getting this too with Fabric "react-native": "0.72.3",
"react-native-screens": "3.22.0",
|
@Sowed I am getting the same issue, can you share your |
@Sowed are you using this |
No @numandev1. The app was building fine until I tested out upgrading the packages to RN {
"dependencies": {
"@expo-google-fonts/dev": "0.2.3",
"@expo-google-fonts/lexend-deca": "0.2.3",
"@expo-google-fonts/noto-sans-arabic": "0.2.3",
"@expo/metro-config": "^0.10.6",
"@expo/webpack-config": "~18.1.1",
"@react-native-async-storage/async-storage": "1.18.2",
"@react-navigation/bottom-tabs": "6.5.7",
"@react-navigation/native": "6.1.6",
"@react-navigation/native-stack": "6.9.12",
"@react-navigation/stack": "6.3.16",
"@shopify/restyle": "2.4.2",
"axios": "^1.3.6",
"date-fns": "^2.29.2",
"expo": "^49.0.3",
"expo-application": "~5.3.0",
"expo-haptics": "~12.4.0",
"expo-linking": "~5.0.2",
"expo-modules-core": "~1.5.7",
"expo-permissions": "14.2.1",
"expo-splash-screen": "~0.20.4",
"i18n-js": "4.3.0",
"lottie-react-native": "^6.0.0-rc.5",
"moti": "0.25.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.3",
"react-native-blob-util": "0.17.3",
"react-native-bootsplash": "4.6.0",
"react-native-code-push": "^8.0.2",
"react-native-codegen": "0.71.5",
"react-native-config": "1.5.0",
"react-native-fs": "2.20.0",
"react-native-gesture-handler": "~2.12.0",
"react-native-keychain": "^8.1.1",
"react-native-mmkv": "2.8.0",
"react-native-modal": "13.0.1",
"react-native-modal-datetime-picker": "15.0.1",
"react-native-reanimated": "3.3.0",
"react-native-safe-area-context": "4.7.1",
"react-native-screens": "3.22.0",
"react-native-svg": "13.10.0",
"react-native-webview": "^13.2.2"
},
"devDependencies": {
"@babel/core": "7.21.4",
"@babel/plugin-proposal-decorators": "7.21.0",
"@babel/plugin-proposal-export-namespace-from": "7.18.9",
"@babel/plugin-proposal-optional-catch-binding": "7.18.6",
"@babel/preset-env": "7.21.4",
"@babel/runtime": "7.21.0",
"@react-native/eslint-config": "^0.72.2",
"@react-native/metro-config": "^0.72.9",
"@rnx-kit/metro-config": "1.3.6",
"@rnx-kit/metro-resolver-symlinks": "0.1.28",
"@rnx-kit/metro-serializer-esbuild": "^0.1.22",
"@tsconfig/react-native": "^3.0.0",
"@types/jest": "^29.2.1",
"@types/react": "~18.2.14",
"@types/react-native": "~0.70.6",
"babel-jest": "29.2.1",
"babel-loader": "8.2.5",
"babel-plugin-root-import": "6.6.0",
"jest": "^29.6.1",
"jest-circus": "26",
"jest-environment-node": "26",
"jest-expo": "49.0.0",
"metro-config": "0.77.0",
"metro-react-native-babel-preset": "0.77.0",
"metro-source-map": "0.73.9",
"mocha": "6",
"patch-package": "6.4.7",
"postinstall-prepare": "1.0.1",
"query-string": "^7.0.1",
"react-devtools-core": "4.24.7",
"react-native-gradle-plugin": "0.71.19",
"react-native-web": "~0.18.7",
"ts-jest": "^29.1.1",
"typescript": "^5.1.3",
"webpack-dev-server": "^3"
}
} |
I'm seeing a possibly related error (in
Possibly pertinent dependencies are (can give the full
|
Description
The app has been inactive for around 2 min on a "enter pin code page" leading to that the iPhone has been locked. If the user then unlocks the phone, enter the pin code and press the login button, the app then crashes.
After setting enabledScreen(false), I have not been able to reproduce a crash.
Exception from Bugsnag:
Screenshots
This is the "breadcrumb" from Bugsnag:
![Screenshot 2021-05-19 at 01 12 07](https://user-images.githubusercontent.com/2823722/118734781-5bf27980-b83f-11eb-8bb5-4bf7be79151f.png)
Package versions
The text was updated successfully, but these errors were encountered: