加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

React Native:target has has hash string’android-X’not fou

发布时间:2020-12-15 06:39:23 所属栏目:百科 来源:网络整理
导读:我试图开发我的第一个 react-native Android应用程序。当我跑 sudo react-native run-android 我得到以下错误 JS server already running.Building and installing the app on the device (cd android ./gradlew installDebug)...FAILURE: Build failed with
我试图开发我的第一个 react-native Android应用程序。当我跑
sudo react-native run-android

我得到以下错误

JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> failed to find target with hash string 'android-23' in: /usr/local/Cellar/android-sdk

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.981 secs
Could not install the app on the device,see the error above.

我有24.3.3在/usr/local/Cellar / android-sdk下安装所有的API-23软件包

我的android / app / build.gradle说

compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
    applicationId "com.awesomeandroid"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a","x86"
    }
}

当我尝试$ ANDROID_HOME,它说-bash:/usr/local/Cellar/android-sdk/24.3.3:是一个目录。

我也在android / app /下添加了local.properties,并添加了sdk.dir = /usr/local/Cellar / android-sdk / 24.3.3

我缺少什么?

您需要将ANDROID_HOME指向平台和平台工具的父目录,以便/usr/local/Cellar / android-sdk

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读