APK issue not present in development

Please provide the following:

  1. SDK Version: 37.0.3
  2. Platforms(Android/iOS/web/all): Android and iOS

I have created an application and published it to Expo, the published version and the development version worked perfectly without any crashes. However, when I create an APK using the expo build:android command, and then run it on my android simulator, the application starts to reload the entire application at a certain point during navigation to a particular screen.

  • I created an ipa and installed it on my iOS simulator and this problem doesn’t happen there.

  • I even tried to run the production build from the expo Dev Tools as well as using the minifying command to start the server, however in none of these cases the error happens again.

Since this is only my 1st real React Native app, I am not sure about what to do next to figure out the issue.

To recreate the issue you can download the APK from this link
Expo APK link
and for comparison you can access the Expo published version of the application from here Expo published app
Upon opening the application, open the SideDrawer and navigate as below:
‘Contact Us’ > ‘Find Us’ (tab navigator) > Go to Locations > Click on any of the card images or press the ‘View Details’ button
In the Expo published application, this will work perfectly and take you to the details page of that card, however in the APK version the app starts to reload instead.

  • I was initially using useNavigation hook to access this last page and thought the crash could be an issue with this hook and instead tried to pass the props.navigation down to the component, still though the issue persisted in android. I am using @react-navigation/native version “5.3.0”

Any direction or pointer would be a big help.

Hello!
Try to import ‘react-native-gesture-handler’ in App.js (make sure it’s at the top and there’s nothing else before it) . I had the same problem.

https://reactnavigation.org/docs/getting-started/;

1 Like