4

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?

Matthew
  • 44,826
  • 10
  • 98
  • 87
Ray Goodwin
  • 183
  • 1
  • 3
  • 9

1 Answers1

4

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).

David
  • 2,399
  • 20
  • 17
  • In addition I think you can hardcode the SDK home in your sbt file...but that's not good practice because it limits mobility. – Nathan Moos Nov 20 '11 at 17:22
  • Thanks for the help I fixed the problem by setting: ~/.MacOSX/environment.plist and editing it with RCenvironment preference pane – Ray Goodwin Nov 20 '11 at 21:01
  • I tried setting the property in `~/.MacOSX/environment.plist`, looks like it has no effect. – Display Name Feb 17 '15 at 18:32