【问题标题】:How to fix "SDK location not found..."?如何修复“未找到 SDK 位置...”?
【发布时间】:2019-09-01 21:00:09
【问题描述】:

运行后sudo react-native run-android
回显错误:

未找到 SDK 位置。使用 local.properties 文件中的 sdk.dir 或使用 ANDROID_HOME 环境变量定义位置。

在 local.properties 中添加 sdk.dir 后可以工作,但我想进行一般性修复。

在 ~/.bashrc 中

export ANDROID_HOME="$HOME/programs/android_sdk" export PATH="$PATH:$ANDROID_HOME/tools" export PATH="$PATH:$ANDROID_HOME/platform-tools"

但不行!
我该如何解决?

【问题讨论】:

标签: android linux react-native ubuntu


【解决方案1】:

尝试像这样添加

在 ~/.bash_profile 或 ~/.bashrc 中添加以下内容。

export ANDROID_HOME=/usr/local/share/android-sdk
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/build-tools/23.0.1:$PATH

以这种方式为我工作。希望它也适合你!

【讨论】:

    猜你喜欢
    • 2015-11-17
    • 2020-10-30
    • 1970-01-01
    • 2022-10-24
    • 2016-06-05
    • 2015-03-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多