Sergey Kucher
Sergey Kucher

Reputation: 4180

Robolectric 1.2 : “WARNING: Unable to find path to Android SDK”

I used

Robolectric 1.1 jar-with-dependencies

in my project and succeed to get it work, however when I changed the jar to

1.2-SNAPSHOT jar-with-dependencies

I get the following warning:

WARNING: Unable to find path to Android SDK

  1. Both jars downloaded from Sonatype (I didn't use maven).
  2. I tried the solution from this question and still get the warning.

Upvotes: 2

Views: 1938

Answers (1)

Feras Alnatsheh
Feras Alnatsheh

Reputation: 547

After I followed this tutorial, I had the same issue. This is how I solved it on my mac:

1- Add Android sdk dir to the bash_profile, first open the file:

sudo vim ~/.bash_profile 

then add the following line: (remember to replace YOUR_ANDROID_SDK_PATH_HERE' with the android SDK file path (e.g. /Users/xxx/development/android-sdk-mac_x86))

export ANDROID_HOME=YOUR_ANDROID_SDK_PATH_HERE

2- Create a file called local.properties in the root dir of your Android project, and add the following line: (remember to replace YOUR_ANDROID_SDK_PATH_HERE' with the android SDK file path (e.g. /Users/xxx/development/android-sdk-mac_x86))

  sdk.dir=YOUR_ANDROID_SDK_PATH_HERE

Upvotes: 3

Related Questions