React-native: React native run-android not working because of incorrect sdk path

Created on 3 Jul 2016  路  11Comments  路  Source: facebook/react-native

  • [ ] Provide a minimal code snippet / rnplay example that reproduces the bug.
  • [ ] Provide screenshots where appropriate

image

Building and installing the app on the device (cd android && gradlew.bat installDebug...
Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
java.lang.RuntimeException: The SDK directory 'C:\react-native\myproj\android\C:UserssaurabhorangeAppDataLocalAndroidsdk' does not exist.

you can observed the path is definitely incorrect , I dont know why its using relative path when I specified absolute path in properties file

  • [ ] What's the version of React Native you're using?
    0.28
  • [ ] Does this occur on iOS, Android or both?
    Android, havnt tried IOS
  • [ ] Are you using Mac, Linux or Windows?
    Windows 10 64 bit
Locked

Most helpful comment

Try sdk.dir = C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk if your on windows

All 11 comments

Can you share what you've set in your local.properties?

sdk.dir = C:\Users\saurabhorange\AppData\Local\Android\sdk

Try opening Android Studio and setting the path of my SDK to Android/sdk (I had to create both folders). That changed the build fail error to: failed to find target with hash string 'android-23' in /Users/mixophrygian/Library/Android/sdk

So in Android Studio -> Preferences -> System Settings -> Android SDK -> Launch Standalone SDK Manager, install Android 6.0 (API 23). Don't forget to install the build tools, as well.

Tried that , It still cannot identify sdk :(,

+1 because im having the same issue... tried everything but it will not read the SDK location.

Try sdk.dir = C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk if your on windows

I think this has been stuck in "needs more information" for a while - perhaps the last comment even solves it - so I am going to close this issue. If you continue to have problems with a reproducible setup then feel free to open a new issue.

I have SDK installed on D:\Tools\Android on windows machine
Trying sdk.dir = D:\Tools\Android,

but no luck.

Try \\ instead of \

Razzeee's answer worked for me.

https://i.stack.imgur.com/dAbCd.png

do this change sdk path to currnt using sdk version

Was this page helpful?
0 / 5 - 0 ratings