Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go back to debugging after created release version with react-native bundle (Android)

So I have created my Application using React native and just produced my first release-build. My problem now is that I can't get back to react natives debug-mode.

By following the documentation, this is what i did.

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/

This code generated the bundled index.android.bundle and index.android.bundle.meta

Now every time I execute react-native run-android, the javascript code-base wont update the application and I am not able to access the development(shake) menu in my app.

If I run react-native bundle again, the code will update.

I guess this is a simple issue, but can't find any information how to return so the app isn't using the bundled version anymore.

like image 425
Furedal Avatar asked Sep 18 '17 10:09

Furedal


2 Answers

  • Delete assets folder in app/src/main/
  • Remove this import line if exist : "import com.facebook.react.BuildConfig;" in MainApplication.java
  • Run "react-native run-android"

And boom!

like image 146
mriza1815 Avatar answered Sep 24 '22 16:09

mriza1815


My quickest way is openning the file: $projectRoot\android\app\src\main\java\com\movies\MainApplication.java, going to the code like:

public boolean getUseDeveloperSupport() {
 return false; //it was changed to false from BuildConfig.DEBUG when released
}

then changing the false to true to make the debug menu available again.

like image 38
Qin Chao Avatar answered Sep 23 '22 16:09

Qin Chao