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

此生再无相见时 提交于 2019-12-11 04:58:42

问题


I am using Robolectric without using maven to build, meaning I am using the Robolectric-with-dependencies Jar.

I set it up based on instructions on Robolectric's site, yet I am still getting the WARNING: Unable to find path to Android SDK" error. I found this link (the first answer) which mentions where the problem is coming from but doesn't answer how I can fix this problem.

I am new and never posted because I can usually find a solution after browsing for awhile, however I had no luck finding the solution. Anything would help. Thanks.


回答1:


make sure to set the ANDROID_HOME environment variable to point to your Android SDK installation, e.g.:

export ANDROID_HOME=/usr/local/Cellar/android-sdk/r15



回答2:


Stefan is correct.

More information can be found in my chapter about Android development with Maven as well as the plugin wiki and documentation for the sdk configuration. I would also recommend to use the latest version of the android maven plugin as well as the Android SDK..



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

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