React native blank screen after generating APK

后端 未结 2 1040
天涯浪人
天涯浪人 2021-02-11 02:37

I\'m using react-native, and everything was working well while I was developing, but, when I built the APK (using this tutorial: https://facebook.github.io/react-native/docs/sig

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-11 03:17

    I guess you are looking for how to generate signed apk.

    it seem you did not have a react.gradle file under android/app: you can bundle the JavaScript package and drawable resources manually by doing the following in a terminal:

    $ mkdir -p android/app/src/main/assets
    $ 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/
    $ cd android && ./gradlew assembleRelease
    

    after following this process app.release.apk will be under android\app\build\outputs\apk directory.

提交回复
热议问题