2

I am consistently running into the same error when I run "react-native run-android." Here is the error:

* What went wrong:
A problem occurred configuring project ':app'.
> failed to find Build Tools revision 23.0.1

I tried this --> failed to find Build Tools revision 21.1.1 - sdk up to date --> and got the same error.

I installed the android sdk with homebrew and my ANDROID_HOME export is in my .bash_profile and .zshrc file as:

export ANDROID_HOME=/usr/local/opt/android-sdk

When I go to this directory and look in the "build-tools" directory I do see 23.0.1.

Does anyone have any advice?

EDITS:

I'm also unable to run "react-native run-android" with any flags. I'm not seeing any output from stacktrace, info or debug.

enter image description here

Community
  • 1
  • 1
Max Baldwin
  • 3,404
  • 3
  • 26
  • 40

2 Answers2

8

Finally figured it out! Chris Geirman's answer is also valuable, so I would start there as I did. One thing to mention is that I installed React Native with Homebrew. If Chris's method does not work look into the following:

  1. Go to your React Native project directory that is created by react-native init
  2. Open the android directory.
  3. Open the file local.propertiesIf you don't have this file you can make one.
  4. Make sure the sdk.dir value is pointing to the correct directory. In my case the path need to be sdk.dir = /usr/local/opt/android-sdk

As an extra bit of reassurance I also located that directory above to make sure that the build tools version that was missing (23.0.1) was in that directory.

EDIT:

I found that this is a post install error. If you run react-native init and you don't have $ANDROID_HOME set, you will run into this error.

Max Baldwin
  • 3,404
  • 3
  • 26
  • 40
  • great to know, and good find! out of curiosity, why did you choose to install via homebrew? and would a new `react-native init` require the same fix every time? – Chris Geirman Nov 18 '15 at 23:02
  • 1
    @ChrisGeirman, just ran a test. This seems to be a post install error. I deleted my directory that ```react-native init``` created and ran it again. Looks like it picked up on the ```$ANDROID_HOME``` variable the second time. I will add that as a note. – Max Baldwin Nov 18 '15 at 23:21
  • 1
    This didn't quite resolve it for me. In the end I also had to go into the *standalone* SDK manager and add the 23.0.1 build-tools. Just checking 23 in Android Studio isn't enough to get it to install the *build-tools* for 23.0.1. Note: Setting the env var before generating the app still required me to manually write the local.properties also. – tgf Jul 13 '16 at 00:05
1

I found this in the book Learning React Native and thought you might find this quote helpful.

If you receive a warning about a missing package, run android and check to see if that package is listed as “installed”. If not, install it. If it is installed, but React Native can’t find it, follow the steps above to try and fix any issues with your development environment. You should also check to make sure that your ANDROID_HOME environ‐ ment variable is properly set and points to your installation of the Android SDK. For example, on my system:

$ echo $ANDROID_HOME
/usr/local/opt/android-sdk
Chris Geirman
  • 9,474
  • 5
  • 37
  • 70
  • I did the echo and my path is correct. I am going to try to uninstall some of the installed packages to see what happens. For future reference do you have a link to that book? Also does it say anything else? – Max Baldwin Nov 11 '15 at 16:11
  • 1
    Haha, it says lots more, but little more related to this issue. Here's a link http://shop.oreilly.com/product/mobile/0636920041511.do – Chris Geirman Nov 11 '15 at 16:14
  • Reinstalled the build tools, no dice. Is there anything Android that I need to be running while I run the react-native command? – Max Baldwin Nov 11 '15 at 16:24
  • I'm only just beginning to play with Android, but I always start VirtualBox, then the VM server within VirtualBox, then Genymotion. From the terminal, in the project's root, I run `react-native start` to start the packages, then `react-native run-android` – Chris Geirman Nov 11 '15 at 16:27
  • Yeah my virtual box is running with Genymotion. Still no dice. I tweeted this question at react, so hopefully they will chime in. Thanks for the time! – Max Baldwin Nov 11 '15 at 16:31
  • Maybe hit the Android channel up more aggressively – Chris Geirman Nov 11 '15 at 16:33
  • Chris, I found an answer. Thought you might be interested. – Max Baldwin Nov 18 '15 at 21:04