3

This is my first time setting up react native on Ubuntu 18.04 LTS. I have done the setup and I was trying to run the app on the device using the react-native run-android command. Here is the output what I get in terminal,

ron@lenovo:~/react/app$ react-native run-android
Scanning folders for symlinks in /home/ron/react/app/node_modules (9ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /home/ron/Android/Sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

File /home/ron/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 26.0.3 in /home/ron/Android/Sdk/licenses
License for package Android SDK Build-Tools 26.0.3 accepted.
Preparing "Install Android SDK Build-Tools 26.0.3 (revision: 26.0.3)".
<=============> 100% CONFIGURING
> IDLE

It stays in this IDLE position forever. What is the fix or this issue?

2 Answers2

5

The solution is to install Android SDK rev. 26.0.3. Your can install it from Android Studio's SDK Manager menu in File > Settings. Hope this helps.

Ronald P Mathews
  • 2,178
  • 1
  • 22
  • 26
0

I got the same error today. The solution is to create a file named local.properties and write in it this line:

sdk.dir=[the position of android sdk]

example:

sdk.dir=N\:\\Users\\andy\\AppData\\Local\\Android\\Sdk

you can get the sdk android via android studio: Android Studio - How to Change Android SDK Path

hope this will help you and other people out there who just begin learning react native.

Dika
  • 2,213
  • 4
  • 33
  • 49
  • @DarielRamosDĂ­azdeVillegas if you create react native project, there should be android folder, and ios folder. put local.properties inside android folder. – Dika Feb 20 '19 at 04:58