Question

I'm having problems running the scala-android plugin when running sbt from inside IntelliJ. When I run sbt for the same project from Mac terminal I get no errors:

 ~/Documents/my-android-project $ sbt
[info] Loading global plugins from /Users/rgoodwin/.sbt/plugins
[info] Loading project definition from /Users/rgoodwin/Documents/my-android-project/project
[info] Set current project to  (in build file:/Users/rgoodwin/Documents/my-android-project/)

But when I try to run sbt from IntelliJ I get:

[info] Loading global plugins from /Users/rgoodwin/.sbt/plugins
[info] Loading project definition from /Users/rgoodwin/Documents/my-android-project/project
[error] Android SDK not found. You might need to set ANDROID_SDK_HOME or ANDROID_SDK_ROOT or ANDROID_HOME
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

Why doesn't sbt inside of IntelliJ pick up the Path names I have set?

Was it helpful?

Solution

I think that you have probably set ANDROID_SDK_HOME in your .bashrc file so this property is set when you run sbt.

When you run Intellij, you don't launch it from command line so the ANDROID_SDK_HOME is not defined when you run sbt from Intellij.

For MacOS, I think that you can set global environment variables (take a look at http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top