I am trying to build my first app with react-native.
I am following these 2 tutorial:
- https://facebook.github.io/react-native/docs/getting-started.html#content
- https://facebook.github.io/react-native/docs/android-setup.html
I am sure that I installed all the requirements from the second link but when I try running my app with react-native run-android
, I get the following error:
I executed this command while running genymotion.
This is all that I have installed in Android SDK:
I tried to install Android build tools 23.0.1 but I get this error:
What should I do?
The error you're getting seems to be related to system's permissions, since it's not able to create a folder.
Try running the sdk-manager using root (with
su
orsudo
commands).Just install it from Android Studio ;)
While running react-native In case you have installed 23.0.3 and it is asking for 23.0.1 simply in your application project directory. Open
anroid/app/build.gradle
and changebuildToolsVersion "23.0.3"
Nothing helped until I found this solution : https://stackoverflow.com/a/39068538/3995091
In Android SDK, the build tools with the correct version where shown as installed, but still I got the same error saying they couldn't be found. When I used the above solution, I found out they were indeed not installed, although Android SDK thought they were. Installing them solved it for me.
Either install v23.0.1 of the build tools (the fifth row in your screenshot), or change your code to use the build tools version you already have installed (v23.0.3). This can be specified in your app's
build.gradle
file:As per duncanc4's comment below,
In the Gradle Console (link available in the window bottom right), you have two tabs: the error is shown in Gradle Build tab. Click on the Gradle Sync tab, then click on the Install Build Tools XX.X.X and sync project link. This will download the build version required by your project.
You may also change your project SDK version but you don't always have this option if it is imposed.