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

吃可爱长大的小学妹 提交于 2019-12-11 00:52:40

问题


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.

回答1:


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


来源:https://stackoverflow.com/questions/12544262/robolectric-1-2-warning-unable-to-find-path-to-android-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!