Mac(Mavericks)上で、react nativeでandroidを動かそうとしたとき、以下のエラーが出ました。
$ 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 Build Tools revision 23.0.1
* 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: 5.203 secs
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:
https://facebook.github.io/react-native/docs/android-setup.html
問題はこいつです。
failed to find Build Tools revision 23.0.1
AndroidSDKのパスなどは通っています。
~/.zshrc
export ANDROID_HOME="/Users/watashi/Library/Android/sdk"
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Android Studio経由で対象のtoolは導入したつもりでした。
しかしダメだったので以下の対応をしました。
対応
SDKのリストを表示します。
$ android list sdk -a
.
.
.
Packages available for installation or update: 160
1- Android SDK Tools, revision 24.4.1
2- Android SDK Tools, revision 25.0.1 rc2
3- Android SDK Platform-tools, revision 23.1
4- Android SDK Build-tools, revision 23.0.2
5- Android SDK Build-tools, revision 23.0.1
... and a great many more
5に今回求められているSDKがありました。
$ android update sdk -a -u -t 5
.
.
.
Installing Archives:
Preparing to install archives
Downloading Android SDK Build-tools, revision 23.0.1
Installing Android SDK Build-tools, revision 23.0.1
Installed Android SDK Build-tools, revision 23.0.199%)
Done. 1 package installed.
ここまでやると、通りました。