1

When I use npx react-native run-android command to run my project on android the live reload feature doesn't work and I can't even bring up the developer menu using Command + M.

When I run the same project on iOS using npx react-native run-ios everything works fine. What am I doing wrong?

I'm using MacOS 10.15.5 and React native 0.62.2. Not using Expo.

CodeHat
  • 384
  • 4
  • 14
  • Not really an answer, but you might not be doing anything wrong - sometimes I see an edit I've made breaks reloading. Just have to rerun the NPX... command to get it restarting and it will work again for a while – Paul Hadfield Jul 09 '20 at 21:45
  • I've tired rerunning it but it still doesn't work. – CodeHat Jul 09 '20 at 22:42
  • Were you able to figure out your issue? just curious about solution. – newdeveloper Jul 10 '20 at 05:07
  • 1
    Just found out that changing `getUseDeveloperSupport()` method in MainApplication.java to `return true` instead of `return BuildConfig.DEBUG` fixes the issue. This is just a work around. – CodeHat Jul 13 '20 at 15:03
  • @CodeHat thnxx it's working by your trick – Asma_Kh Jan 13 '21 at 13:34
  • @Asma_Kh glad i could help and thanks for letting me know. Please up vote the answers so it can help others as well. – CodeHat Jan 14 '21 at 19:05

1 Answers1

0

Managed to fix this. There were two issues with my project. Firstly BuildConfig was being imported from react in my MainApplication.java file. According to this post: https://stackoverflow.com/a/43183752/9295598 it should come from my package. Once I resolved this I noticed that my package name didn't match my folder structure. Seem like I renamed my project in the past and didn't update the folder structure.

Once the folder structure was fixed and BuildConfig was imported from my project, the BuildConfig.DEBUG started working as intended which fixed the rest of the issues.

CodeHat
  • 384
  • 4
  • 14