-
Notifications
You must be signed in to change notification settings - Fork 77
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 crash when unmounting PaywallFooterContainerView: java.lang.IllegalStateException: No ViewModelStoreOwner was provided via LocalViewModelStoreOwner #994
Comments
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out! |
Hey @carter-0 ! Thanks for reaching out, this error usually happens when LocalViewModelStoreOwner.current is set to null. Can you please verify that this doesn't get set to null, it could be because of something like a rerender being triggered by your code. This could be the result of something in your switch case causing an issue or the state not being re-rendered properly. Let me know if that helps! |
@michaelAtRC Thanks for the response but I can't figure out how to check this. Is LocalViewModelStoreOwner not a Kotlin native component handled by react-native-purchases-ui? or is there a way to access this from react native? Sorry for the ignorance, I'm pretty new to react native & app development😅 |
I'm experiencing this crash as well. Dismissing the paywall footer on Android causes the app to crash every time |
For what it's worth, I'm not using any custom UI with my footer. I'm simply displaying it inside a BottomSheet. @carter-0 I was able to stop this crash from happening by commenting out this line: Line 24 in 3299266
This is fine for my use-case because my view isn't ever updating since I'm not using custom UI with my footer, which is the purpose of that call. The crash is 100% happening somewhere inside the I think I'll just have to patch the library to comment that line to get my app working properly. |
Thanks @Watersdr, I can confirm commenting that line out also fixes the crash for me, even with custom ui in the footer. I haven't noticed any other effects so far so I'm also going to patch the lib as a temporary fix. |
Describe the bug
When unmounting the RevenueCatUI.PaywallFooterContainerView on Android devices,
java.lang.IllegalStateException: No ViewModelStoreOwner was provided via LocalViewModelStoreOwner
is thrown.Expected behaviour: Paywall footer will be shown and then hidden without any issues
Actual behaviour: Paywall footer is shown succesfully but crashes when unmounted.
Here is a video demonstration of the expected behaviour (on iOS) vs the actual behaviour (on Android) with the exact same code:
8mb.video-7Gv-j6y8b5cE.mp4
The text was updated successfully, but these errors were encountered: