本文介绍了使用create-react-native-app创建了一个应用程序,如何将其发布到Google Play商店?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用create-react-native-app创建了一个应用,但是我不确定如何将其发布到Google Play商店。

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

错误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"


推荐答案

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

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

一条途径是使用Expo(我从事的项目) exp 命令行工具来构建APK。 exp 命令行工具(和XDE GUI程序)可以加载使用CRNA创建的项目。设置完成后,您可以运行 exp build:android 并在几分钟内收到一个APK。

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.

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

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"
   }
}

这些是讨论构建APK(以及iOS的IPA)的文档:

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

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

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.

这篇关于使用create-react-native-app创建了一个应用程序,如何将其发布到Google Play商店?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 10:56