【发布时间】:2015-10-12 19:40:44
【问题描述】:
我已经尝试在 sbt 中创建一个 android 项目已经有 2 天了,而且我经常跑来跑去。从一开始我就一直在关注本教程来创建sbt+android+intellij IDE project。然后将我引向android-sdk-plugin。在我最终能够执行sbt gen-android 命令在命令行中创建一个android 项目之前,我必须下载sdks 并设置路径。但是,当创建 android sbt 项目时,以下 cmd 行命令 android update project -p . 不会执行,因为清单不在根文件夹中。
我通过查看类型安全的 scaloid 模板示例进行了故障排除。因此,我的解决方法是将清单文件和 res 文件都传输到 sbt 项目的根目录,并将 android 包移动到 src 文件夹的根目录,以使 android update 工作。在导入同一个项目后,我的 sbt 项目将在终端中编译,而不是在 intellij 中编译。
在开始此过程之前,尝试仅使用 IDE 创建一个 sbt android 项目,但我在编译期间遇到 ANDROID_HOME not set 错误。现在一切都设置为 PATHS 和 sdks 之后,我在 sbt 编译时收到以下错误..
[info] Processing resources
[trace] Stack trace suppressed: run 'last compile:compile' for the full output.
[error] (compile:compile) java.lang.IllegalArgumentException: Lint must be invoked with the System property com.android.tools.lint.bindir pointing to the ANDROID_SDK tools directory
在终端中来自我在sbt compile..之后得到的完全相同的文件夹。
[info] Loading global plugins from /Users/StramzCB/.sbt/0.13/plugins
[info] Loading project definition from /Users/StramzCB/Desktop/sbt+intJ/hello-scaloid-sbt-master/project
[info] Set current project to hello-scaloid-sbt (in build file:/Users/StramzCB/Desktop/sbt+intJ/hello-scaloid-sbt-master/)
[info] Processing resources
[success] Total time: 1 s, completed Jul 22, 2015 2:36:10 PM
请帮助我正确创建和 android+sbt+intellij 项目的当前方式。否则,由于 65k 方法限制,我可能不得不求助于将源文件复制到 sbt 项目中来编译 apk。
【问题讨论】:
-
另外,您不使用 intellij 构建。添加一个运行配置先执行android:package
-
android 更新项目仅适用于旧的基于 ant 的构建
标签: android scala intellij-idea sbt