kanzitelli / rnn-starter

šŸ¤¹ React Native Starter - Powered by cli-rn, React Native Navigation, Expo Modules, RNN Screens, RN UI lib, MMKV, Mobx, Reanimated 2, Dark Mode, Splash Screen, Localization, Notifications, Permissions, and much more.
https://starters.dev
MIT License
549 stars 72 forks source link

Back event does not work when on root activity #99

Closed FawadMahmood closed 2 years ago

FawadMahmood commented 2 years ago

firstly thank you for such great work and keeping this repo updated.

When we are on the root activity back button does not work, maybe a bug from Wix native navigation.

Also crashes on release complete and sometimes on debug.

kanzitelli commented 2 years ago

hey @FawadMahmood! glad to hear that!

could you provide more information about your navigation and screens structure? are you using rnn-screens? any extra logs, video or reproduction repo would be also helpful :)

FawadMahmood commented 2 years ago

Well, there are a few issues I see,

Release build crashes with the following error

couldn't find DSO to load: libjscexecutor. so also couldn't find DSO to load: liberties-executor-debug. so

To reproduce, please just create a release build of the same working repo of this codebase.

Secondly, for the back button issue, you can try pressing the hardware back button on the root activity of tabs.

FawadMahmood commented 2 years ago

I am sharing error issues in Latest version of this repo without making any changes.

kanzitelli commented 2 years ago

There are a lot of issues regarding ā€œCouldnā€™t find DSO to loadā€ in react-native repository. For example, this solution helps people ā€” https://github.com/facebook/react-native/issues/25537#issuecomment-1182498993

Hardware back button from root activity is broken indeed. I just tested and it freezes navigation for the same times you press on back button. Probably, thatā€™s the issue with RNN and latest changes in 7.30.0-alpha1 where they have added support for ā€œpredictiveā€ navigation.

Iā€™m currently on the vacation and will try to ship RN 0.70 asap to be able to test that. Also it will make sense to try RNN 7.30.0-alpha (not alpha1), maybe itā€™ll work. But it will need some native code changes (not big ones tho) as Kotlin versions are different.

FawadMahmood commented 2 years ago

Hello brother, I have a working of this repo on React Native .70, I can send a pull request or can share the repo with you.

That has no release build issues I have checked.

Also, thereā€™s one more issue I see, using withObserver causing an issues with React Native fast refresh on screens.

kanzitelli commented 2 years ago

Yes, sure, PR would be great! Because Iā€™ve started RN 0.70 integration to starters-dev/rnn-with-expo (thatā€™s where i test first), but had problems with iOS part and Hermes framework not being found. There are some open issues and a solution (but not a stable one).

But still I had the issue with back button on RN 0.70 and RNN 7.30.0-alpha1. Do you see that error or itā€™s gone? Maybe itā€™s just my old Android device.

And what do you mean by issues with withObserver? Never experienced that. There were usually problems with RNN and fast refresh (reload) but I donā€™t remember seeing them lately.

FawadMahmood commented 2 years ago

No the back button issue is still there, even I have upgraded react native and expo,

kanzitelli commented 2 years ago

Yeah, that is right, didn't notice it before šŸ˜„ so just remove withObserver and wrap each screen with observer(...). I've sent the commit.

FawadMahmood commented 2 years ago

@kanzitelli

Yeah, that is right, didn't notice it before šŸ˜„ so just remove withObserver and wrap each screen with observer(...). I've sent the commit.

Yes it does fixes the issue, Thank you.

I have sent the pull request with v.70 React Native and tested it with 2 working projects already, I see no issues so far.

kanzitelli commented 2 years ago

Hello @FawadMahmood! Thank you for your contribution! I have created another PR (as there were some other changes) and mentioned you as a co-author.

FawadMahmood commented 2 years ago

Happy to see this new update, Thank you for keeping this repository updated, it really help :)