面临的问题无法安装该应用程序.确保您拥有Android开发环境“在本地反应 [英] Facing issue " Failed to install the app. Make sure you have the Android development environment " in react native
问题描述
请您帮帮我,我很想在react-native中创建一个新项目,如下面的屏幕截图所示.我能够运行旧项目.但我无法运行新项目
Would you please help me, I am stuck to create a new project in react-native Like below screenshot. I have able to run old projects. but I am not able to run a new project
我已按照以下步骤操作:
I have followed these steps:
-
react-native init projectName
-
cd projectName
-
react-native run-projectName
react-native init projectName
cd projectName
react-native run-projectName
但是我得到以下错误:
error Failed to install the app. Make sure you have the Android development environment set up:
推荐答案
要确保为Android正确设置了环境,请转至react-native项目的根目录.在Android Studio IDE中打开android项目(文件夹).
To make sure your environment is setup properly for android, go to the root of your react-native project. Open the android project(folder) in the Android Studio IDE.
与环境有关的所有错误都会显示出来,并且会自动启动Gradle Daemon来为您同步和配置构建.完成后,关闭Android Studio,然后返回命令行并运行:react-native run-android
All errors with your environment will show up, and that will automatically start the Gradle Daemon to sync and configure the build for you. Once it finished, close the Android Studio and come back to command-line and run: react-native run-android
这很好.
这篇关于面临的问题无法安装该应用程序.确保您拥有Android开发环境“在本地反应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!