-2

I trying to run the react-native run-android through my React Project. After that, I got this error

Ali SabziNezhad
  • 3,050
  • 1
  • 17
  • 31
dina omari
  • 41
  • 2
  • 3
  • 7
  • It is ok that you attach an image of the problem. However, it would be recommended to write a brief description of the problem and which method to fix the problem you tried. – julianfperez May 19 '18 at 07:57

3 Answers3

1

If you are installed sdk correctly, you can create an empty file in your android project named "local.properties" (if it does not exist) and define sdk address in it like this:

sdk.dir=/home/USERNAME/Android/Sdk

This address may changes based on your settings, it's the default address in linux. I hope it helps you

Ali SabziNezhad
  • 3,050
  • 1
  • 17
  • 31
0

I assume that you are using windows. Add an environment variable ANDROID_HOME that points to

C:\Users\<your-user-name>\AppData\Local\Android\Sdk
Yossi
  • 5,577
  • 7
  • 41
  • 76
  • https://stackoverflow.com/questions/32634352/react-native-android-build-failed-sdk-location-not-found – Yossi May 19 '18 at 07:54
0

You must follow the steps described in the URL:

https://facebook.github.io/react-native/docs/getting-started.html

go to Building Project with native Code and follow the steps and you must have a virtual or real device for testing. To check if any device is connected or not just go to your terminal and type adb devices and if there is any device it will show.

Rajesh Bhartia
  • 690
  • 4
  • 10