うちのいぬ Tech Blog

Tech Blog of Uchinoinu/My dog

1.1 When I tried to run Android app by ReactNative, Error "failed to find Build Tools revision 23.0.1" has shown up

When I tried to run Android application implemented by React Native on Mac(Mavericks), errors below has shown up.

$ 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 Path is ok.

export ANDROID_HOME="/Users/watashi/Library/Android/sdk"
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Tool seems to be installed via Android Studio. But something went wrong.

Solution

Show SDK list.

$ 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

I found target SDK at no.5

$ 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.

Now everything goes well.

http://stackoverflow.com/questions/27272605/failed-to-find-build-tools-revision-21-1-1-sdk-up-to-date