![](/img/trans.png)
[英]Why can I not push a number into my array of strings even though I have converted the number back to a string?
[英]I can't run my react native code even though I have an emulator running in the back round
我正在尝试运行React本机代码,但是当我使用react-native run-android时,出现此错误消息。 我正在使用android studio。
~/Downloads/BrainG-master$ sudo react-native run-android
Scanning folders for symlinks in /home/luke/Downloads/BrainG-
master/node_modules (10ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew
installDebug)...
: No such file or directory
Could not install the app on the device, read the error above for
details.
Make sure you have an Android emulator running or a device connected
and have
set up your Android development environment:
确保
/Downloads/BrainG-master
有一个android
目录(我希望您不要从android目录中运行react-native run-android
),
BrainG-master/android
中的local.properties
文件以以下格式指定了android SDK的位置: sdk.dir=/Users/username/pathToYourAndroidSdk
。
如果没有local.properties
文件,请在Android Studio中打开该项目,它将为您创建该项目。
如果您使用的是Linux,则还可以这样配置android家庭环境:
将以下行添加到$ HOME / .bash_profile配置文件中:
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
.bash_profile
特定于bash
。 如果您使用的是其他外壳,则需要编辑相应的特定于外壳的配置文件。键入source
$HOME/.bash_profile
以将配置加载到当前的shell中。 通过运行echo $PATH
验证是否已将ANDROID_HOME
添加到您的路径。
您可以按照以下说明进行操作: https : //facebook.github.io/react-native/docs/getting-started.html#2-install-the-android-sdk
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.