我试图开发我的第一个
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
原文链接:https://www.f2er.com/react/302234.html