【问题标题】:scala-android pluginscala-android 插件
【发布时间】:2012-01-02 10:31:14
【问题描述】:

从 IntelliJ 内部运行 sbt 时,我在运行 scala-android 插件时遇到问题。当我从 Mac 终端为同一个项目运行 sbt 时,我没有收到任何错误:

 ~/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/)

但是当我尝试从 IntelliJ 运行 sbt 时,我得到:

[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? 

为什么 IntelliJ 内部的 sbt 不获取我设置的路径名称?

【问题讨论】:

    标签: android scala sbt sbt-android


    【解决方案1】:

    我认为您可能在您的.bashrc 文件中设置了ANDROID_SDK_HOME,所以当您运行sbt 时会设置此属性。

    当您运行 Intellij 时,您不会从命令行启动它,因此当您从 Intellij 运行 sbt 时不会定义 ANDROID_SDK_HOME

    对于MacOS,我认为你可以设置全局环境变量(看看http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html)。

    【讨论】:

    • 此外,我认为您可以在 sbt 文件中硬编码 SDK 主页...但这不是好的做法,因为它会限制移动性。
    • 感谢您的帮助,我通过设置解决了问题:~/.MacOSX/environment.plist 并使用 RCenvironment 首选项窗格进行编辑
    • 我尝试在~/.MacOSX/environment.plist中设置属性,好像没有效果。
    猜你喜欢
    • 2012-06-26
    • 2012-07-07
    • 2013-05-24
    • 2012-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-06
    • 2011-02-20
    相关资源
    最近更新 更多