使用create-react-native-app创建了一个应用,如何将其发布到Google Play商店?

ken*_*ter 16 react-native create-react-app expo

我用create-react-native-app创建了一个应用程序,但我不确定如何将其发布到Google Play商店.

错误1

看完这篇文档后.

; exp build:android
[exp] Making sure project is set up correctly...
/[exp] Warning: Not using the Expo fork of react-native. See https://docs.expo.io/.
\[exp] Warning: 'react-native' peer depencency missing. Run `npm ls` in /var/www/html/test/testme/osmosis-seek-android to see full warning.
[exp] 
[exp] If there is an issue running your project, please run `npm install` in /var/www/html/test/testme/osmosis-seek-android and restart.
[exp] Your project looks good!
[exp] Checking if current build exists...

[exp] No currently active or previous builds for this project.

? Would you like to upload a keystore or have us generate one for you?
If you don't know what this means, let us handle it! :)
 false
[exp] Starting build process...
[exp] Publishing...
[exp] Published
[exp] Your URL is

https://exp.host/@kenpeter/osmosis-seek-android

[exp] Building...
[exp] Must specify a java package in order to build this experience for Android. Please specify one in app.json at "expo.android.package"
Run Code Online (Sandbox Code Playgroud)

ide*_*ide 24

使用create-react-native-app您创建的项目有两条通往Google Play商店的路径.

使用Expo exp build命令

一条路是使用Expo(我工作的项目)exp命令行工具来构建APK.该exp命令行工具(与XDE GUI程序)可以加载与CRNA创建的项目.设置完成后,您可以exp build:android在几分钟内运行并接收APK.

第一次执行此操作时,您必须向APK 添加一些信息expo.jsonapp.json(无论您有哪些).具体来说,您需要像这样指定Java包名称(重要的是它是一个有效的Java包名称!):

{
   android: {
       package: "com.example.myapp"
   }
}
Run Code Online (Sandbox Code Playgroud)

这些是关于构建APK(以及iOS的IPA)的文档:https://docs.expo.io/versions/latest/guides/building-standalone-apps.html

手动弹出并构建APK

另一条路径是使用CRNA的eject命令,它为您创建Xcode和Android项目文件.然后你就像任何其他React Native Android应用程序一样创建一个APK并将其提交到Play商店.这种方法的缺点之一是,在您退出CRNA后,您无法使用CRNA的工具,并且将来不会为您进行升级.

  • 弹出后,我们不能使用CRNA工具意味着我们不能使用所有的热重装,调试和东西吧?什么"将来不会为你升级"是什么意思? (2认同)

Oma*_*hag 5

{
  "expo": {
    "sdkVersion": "26.0.0",
    "name": "TongPos",
    "description": "your app desc",
    "android": {
      "package": "com.sohagfaruque.xxxx"
    }
  }

}
Run Code Online (Sandbox Code Playgroud)

请像上面提到的那样编辑您的app.json。那对我有用。