Unable to load script from assets 'index.android.bundle'.

后端 未结 3 490
抹茶落季
抹茶落季 2020-12-15 13:05

I get this error after building apk with ./gradlew assembleDebug. If I build apk with ./gradlew assembleRelease, I get an error on install app on mobile phone. When

3条回答
  •  盖世英雄少女心
    2020-12-15 13:29

    Here are the steps i need you to follow to solve this issue.

    Delete android folder and do react-native upgrade (not react-native run-android)

    create the folder in the following location.

    your_app/android/app/src/main
    

    Perform the following command in root directory. (simply copy and paste the below code)

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

    Please note if you are using index.android.js then replace it in --entry-file.

    and lastly

    cd android && ./gradlew installDebug
    

    Hope this solves your solution.

提交回复
热议问题