Reputation: 41
I have a react-native app which works correctly in Android debug builds but doesn't work in Android the release builds.
The app is using redux, axios and react-navigation:
All of this works fine in debug mode both on a real Android device and on the emulator (react-native run-android).
When I run a release build (react-native run-android --variant=release), it compiles and installs and loads the home screen as before but when I press the search button it doesn't navigate to the search results. There is no error.
Things I have tested:
Is the app triggering and exception/error?
Is the API request being triggered?
Does the API SSL cert meet android requirements?
Is an outdated dependancy causing the failure?
How do I work out what is causing the failure?
Upvotes: 1
Views: 907
Reputation: 41
It turns out the minification of the Javascript bundle was breaking my code.
No error was being output because the exception was thrown in an async function.
I was able to disable minification of the bundle by passing "--minify=false" to the packager via app/build.gradle:
project.ext.react = [
entryFile: "index.js",
enableHermes: false,
extraPackagerArgs: [ '--minify=false' ]
]
Upvotes: 1