简体   繁体   English

从create studio中弹出后,在android studio中运行react本机项目的步骤是本机的

[英]Steps to run a react native project in android studio after eject from create react native

What are the steps to run a react native project in android studio after eject from create react native. 在从弹出创建反应本机后, 在android studio中运行react本机项目的步骤是什么。 I didn't find a helpful step by step description online for this. 我没有在网上找到有用的一步一步的描述 I am pretty new to android development, facing different problems related to gradle versions and other stuffs in android. 我对Android开发很新,面对与gradle版本相关的不同问题以及android中的其他东西。 Do I need to run it from android studio , or just need to run the command npm run android 我是否需要从android studio运行它,或者只需要运行命令npm run android

Install React Native using Mac OS 使用Mac OS安装React Native

Please check React Native Document before start. 请在开始之前检查React Native Document。 https://facebook.github.io/react-native/docs/getting-started.html https://facebook.github.io/react-native/docs/getting-started.html

If you don't have install brew in your computer then must hit that command line. 如果您的计算机中没有安装brew,则必须点击该命令行。

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then Follow the Command step to step 然后按照Command步骤进行操作

brew install node

Once Complete node step up then you must Create React Native Directory in your Computer to do this follow the Following Steps: 完成节点后,您必须在计算机中创建React Native Directory才能执行以下步骤:

Open Terminal and hit… 打开终端并点击......

cd

cd Documents

mkdir react-native

cd react-native/

Now You create your React Native Directory now once it's done. 现在,一旦完成,您就可以创建React Native Directory。

Node comes with npm, which lets you install the React Native command line interface. Node附带了npm,它允许您安装React Native命令行界面。

Run the following command in a Terminal: 在终端中运行以下命令:

npm i react-native-cli - g

it need some time to complete install once it's done make sure you check it's npm version to do that hit the following command line. 一旦完成安装,它需要一些时间来完成安装,确保你检查它的npm版本来执行以下命令行。

npm -v 

So you get your version code if you are using 4.6.1 above then maybe you are using some of the problems so remove above version and use this of a version using this command line. 因此,如果您使用上面的4.6.1,那么您将获得您的版本代码,那么您可能正在使用某些问题,因此请删除以上版本并使用此命令行使用此版本。

npm I -g npm@4.6.1

Hit enter and you start with that npm version. 按Enter键,然后从npm版本开始。 So it's Done now Follow the React Native Document if you are using Android and iOS then you can follow the Steps but skip installation node step because we set up all those steps and once you are using Setup Android or Xcode in your pc Follow the Command to run React Native app. 所以它现在完成如果你使用的是Android和iOS,那么你可以按照步骤跳过安装节点,因为我们设置了所有这些步骤,一旦你在你的电脑上使用安装程序Android或Xcode,请按照命令运行React Native应用程序。

Using your React Native Folder that you create in a directory like this 使用您在此类目录中创建的React Native Folder

cd

cd Documents

mkdir react-native

cd react-native/

react-native init HelloWorld

Here we are Create our HelloWorld Programme Using Android Studio and React Native. 在这里,我们使用Android Studio和React Native创建我们的HelloWorld程序。

Once you have ejected you need to run below commands 一旦弹出,你需要运行以下命令

  • exp run exp运行
  • react-native run-android react-native run-android

Make sure exp is installed. 确保已安装exp exp run will serve the js bundle locally which will be accessed when your android app runs via react-native run-android command on simulator or connected device. exp run将在本地提供js包,当你的android应用程序通过模拟器或连接设备上的react-native run-android命令运行时将访问它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React Native NPM运行弹出错误Visual Studio - React Native NPM run eject error Visual studio React Native Run Android - React Native Run Android 如何修复错误说“任务:app:installDebug FAILED”,同时在android studio中运行我的反应本机项目? - How to fix error saying “Task :app:installDebug FAILED”, while run my react native project in android studio? 无法创建React Native项目 - Failed to create a react native project 在Android Studio模拟器上反应原生 - React Native on Android Studio Emulator 如何在Android Studio的React本机项目中包含外部库? - How to include an external library in a React native project in Android Studio? 从Xcode运行时,React Native项目无法加载 - React Native project fails to load when I run from Xcode 反应本机博览会弹出后的问题:“RCTAsyncLocalStorage”没有可见的@interface 声明了选择器“initWithStorageDirectory:” - Issue after react native expo eject: No visible @interface for 'RCTAsyncLocalStorage' declares the selector 'initWithStorageDirectory:' 当我运行项目时,我使用本机警告:ViewPager Android has been extract from react-native? - When I run the project I use the native warning: ViewPager Android has been extracted from react-native? React Native,为什么 react-native run-android 不起作用? - React Native, why is react-native run-android not working?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM