Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native: Debug and Release builds don't work the same

So the app I was working on seemed to work just fine, it was building alright with react-native run-android and everything was just dandy, however when I moved over to my ./android directory and hit gradlew assembleRelease, the resulting apk wasn't the same app I was working with before, and was wrought with bugs that I had fixed in the debug version -- it was almost like it was building my old files.

npm cache clear --force and the likes didn't really seem to help, neither did deleting my build folder in ./android/app/

Others with similar issues found that their issues stemmed from their code or another package, but with a bit (more like a lot) of testing, it didn't seem to be the case with me.

RN: 0.57.7

npm: 6.4.1

Platform: Windows 10

like image 536
SSBakh Avatar asked Nov 07 '22 23:11

SSBakh


1 Answers

The issue was with my gradle wrappers and was fixed with moving to my android directory and entering: gradlew clean

Here's an explanation as to what it does, as opposed to similar commands

Running gradlew assembleRelease again in this directory generated a release apk that was just fine.

like image 57
SSBakh Avatar answered Nov 15 '22 08:11

SSBakh