Reputation: 350
Some time ago i added configuration for signing into my gradle build (and maybe did some other things which git didn't get or whatever). But since this moment on and after my first succesfull release build, I was never ever able to build a debug build again.
What happens now when I do a normal debug build (as before worked with react-native run-android
or Android Studio debug build) in logcat:
unable to load script from assets 'index.android.bundle'
And the app crashes immediately. (Also when setting adb reverse and all these things or even using an emulator; And yes my development server is also started).
Some poeple here and on GitHub said, this could help:
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
And yes my app doesn't crash and I can test it, but i can't open the developer menu. Whether i shake my device or using the command:
adb shell input keyevent 82
On iOS everything is working fine. I checked and diff my gradle files, but couldn't detect any issue or misconfiguration.
What I want to have is a working debug version, which loads all the content from the developer server and a working developer menu with all the nice features of react native.
RN Version: 0.49.1 (and before 0.47.1)
Thank you in advance!
Upvotes: 7
Views: 10271
Reputation: 3242
First delete import which ends with .BuildConifg
from MainApplication.java
then ,Use this command to fix problem
react-native upgrade
Upvotes: 2
Reputation: 1178
Sometimes this is a problem with a wrong import in the MainApplication.java
, where you have to check if any *.BuildConfig is in the imports. If yes, remove that then it should work.
Upvotes: 35