配置android_sdk_root环境变量
通过设置Android模拟器进行React Native的过程 以下网站上的React文档。
说明就是这样:
将以下行添加到您的$ home/.bash_profile或$ home/.bashrc(如果使用zsh,则〜/.zprofile或〜/.zshrc)配置文件:
export android_sdk_root = $ home/liblary/liblary/ Android/SDK 导出
路径= $路径:$ android_sdk_root/仿真器 导出路径= $路径:$ android_sdk_root/platform-tools
My设备:2019 Intel MacBook Pro with Macos Monterey 12.3
我尝试了VIM.ZProfile,无济于事。老实说,不确定如何进行。
当我运行反应本地运行android时,构建总是失败
Going through process of setting up Android emulator for React Native
Following React documentation on website.
Instructions are as such:
Add the following lines to your $HOME/.bash_profile or $HOME/.bashrc (if you are using zsh then ~/.zprofile or ~/.zshrc) config file:
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
export
PATH=$PATH:$ANDROID_SDK_ROOT/emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
My device: 2019 Intel MacBook Pro with macOS Monterey 12.3
I tried vim.zprofile to no avail. Honestly not sure how to proceed.
when i run react-native run-android the build always fails
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先从终端打开相应的文件
使用
*use .bashrc (如果您使用 zsh,则使用 ~/.zprofile 或 ~/.zshrc)
,然后在文本文件打开时将相应的行添加到该文本文件中。
点击保存
检查是否正确完成
键入 source
$HOME/.bash_profile
for bash 或source $HOME/.zprofile
将配置加载到当前 shell 中。通过运行
echo $ANDROID_SDK_ROOT
验证 ANDROID_SDK_ROOT 是否已设置,并且通过运行 ``echo $PATH``` 已将适当的目录添加到您的路径中First Open the respective file from terminal
using
*use .bashrc (if you are using zsh then ~/.zprofile or ~/.zshrc)
then when the text file opens add the respective lines to this text file.
hit save
CHECK IF THIS IS DONE CORRECTLY
Type source
$HOME/.bash_profile
for bash orsource $HOME/.zprofile
to load the config into your current shell.Verify that ANDROID_SDK_ROOT has been set by running
echo $ANDROID_SDK_ROOT
and the appropriate directories have been added to your path by running ``echo $PATH```