How to fix SDK build tools revision too low error when running “react-native run-android” command

Welcome to “Troubleshooting React Native” series. I am writing this series for React Native beginners to provide simple solutions to common frustrating problems. With React Native you dont just have to deal with Javascript errors but also errors related to native Android and iOS build tools.

In early days of developing with React Native, one of the problems you could face is get an error when you try to link a third party library with your React Native App, which is a very common thing to do. For example Facebook SDK (which powers Facebook Login and Facebook Analytics among other things). Sometimes it will occur when you are trying to compile an existing app. Here’s what the error says:


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ‘:app’.
> Could not resolve all dependencies for configuration ‘:app:_debugApk’.
> A problem occurred configuring project ‘:react-native-fbsdk’.
> The SDK Build Tools revision (23.0.1) is too low for project ‘:react-native-fbsdk’. Minimum required is 25.0.0

* 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: 2.113 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

Fortunately it’s a very simple fix, you just have to follow these steps:

  • Open Android Studio.
  • Go to File -> Open
  • Navigate to your-react-native-project/android, select it and click open.
  • Once it has analyzed your app it should show you error(s) on the bottom:
  • Click on “Update Build Tools version and sync project” underneath each error.
  • That’s it, you can run the app from Android Studio by clicking on the play icon or execute the “react-native run-android” command again from terminal. However before you do that make sure you have an emulator running or a phone connected as it won’t automatically launch an emulator instance.

You might see the same error when trying to link other libraries as well, and is not limited to react-native-fbsdk. However the procedure to fix it remains the same.

Hope this helps someone just starting out, if you are having any other issues let me know in the comments and I will help you figure it out!

The very first Facebook Developer Event in Dubai.

Few days back I had the opportunity to go to the first ever Facebook Developer event in Dubai.

It was an invite only event where they had three topics to choose from, Messenger Bots, Account Kit and React Native. I chose React Native because I started working with it a few months back and have been enjoying it quite a lot.

My badge.

They told everyone to come prepared with a development environment setup for React Native development in advance which I had already setup for my own projects.

They had a Hands on Code Lab in which they asked everyone to initialize a React Native project do a simple task, I was able to get going pretty quick as I knew how to set it up so I took the opportunity to help other folks who were new to React Native.

What I found the most helpful was that they talked about how to build React Native apps for emerging markets, under powered phones and talked about all the tools facebook has made that help you build apps for under powered phones especially budget Android phones.

During the event.

The event was hosted at INKED inside Alserkal Avenue in Dubai and they even had delicious food.

All in all it was a great experience, I met some like minded folks who I wouldn’t have met otherwise, I am glad I was invited and I hope Facebook does it ever year.