Created an app with create-react-native-app, how to publish it to the Google Play Store?

后端 未结 2 1908
闹比i
闹比i 2021-02-01 07:24

I have created an app with create-react-native-app, but I am not sure how to publish it to google play store.

Error 1

After reading this doc.

2条回答
  •  遥遥无期
    2021-02-01 08:03

    With projects created using create-react-native-app you have two paths to the Google Play Store.

    Use the Expo exp build command

    One path is to use the Expo (a project I work on) exp command-line tool to build the APK. The exp command-line tool (and XDE GUI program) can load projects created with CRNA. After getting set up, you can run exp build:android and receive an APK in a few minutes.

    The first time you do this, you'll have to add some information to expo.json or app.json (whichever you have) that's required for the APK. Specifically you need to specify the Java package name like this (it's important it's a valid Java package name!):

    {
       android: {
           package: "com.example.myapp"
       }
    }
    

    These are the docs that talk about building an APK (and IPA for iOS): https://docs.expo.io/versions/latest/guides/building-standalone-apps.html

    Eject and build an APK manually

    Another path is to use CRNA's eject command, which creates Xcode and Android project files for you. Then you'd create an APK and submit it to the Play Store like any other React Native Android app. One of the downsides of this approach is that after you've ejected from CRNA, you don't get to use CRNA's tools and it won't take care of upgrades for you in the future.

提交回复
热议问题