Robolectric 1.2:“警告:无法找到路径到Android SDK” [英] Robolectric 1.2 : “WARNING: Unable to find path to Android SDK”

查看:133
本文介绍了Robolectric 1.2:“警告:无法找到路径到Android SDK”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用


  

Robolectric 1.1罐与 - 依赖


在我的项目并取得成功时,我改变了罐子里得到它的工作,但是


  

1.2-SNAPSHOT罐与 - 依赖


我得到以下警告:


  

警告:无法找到Android SDK中路径



  1. Sonatype的(我没有下载的两个罐子使用Maven)。

  2. 我试图从溶液<一个href=\"http://stackoverflow.com/questions/9352903/robolectric-warning-unable-to-find-path-to-android-sdk\">this问题仍然得到警告。


解决方案

我跟着这个的教程,我有同样的问题。这是我如何解决它在我的Mac:

1 Android SDK中dir添加到.bash_profile中,先打开文件:

 须藤vim的〜/ .bash_profile中

然后添加以下行:(记住了Android SDK文件的路径(例如/用户/ XXX /开发/ Android的SDK-mac_x86)取代YOUR_ANDROID_SDK_PATH_HERE')

 出口ANDROID_HOME = YOUR_ANDROID_SDK_PATH_HERE

2 - 创建一个名为在你的Andr​​oid项目的根目录local.properties文件,并添加以下行:(记住了Android SDK文件路径(如/用户/ XXX /开发/ android-更换YOUR_ANDROID_SDK_PATH_HERE SDK-mac_x86))

  sdk.dir = YOUR_ANDROID_SDK_PATH_HERE

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.

解决方案

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

这篇关于Robolectric 1.2:“警告:无法找到路径到Android SDK”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆