由于 libraryProject 错误,sbt android 不会 运行 android:package 在示例项目 multiproject-same-dependencies 上

sbt android won't run android:package on example project multiproject-same-dependencies because of libraryProject errors

我检查了 sbt-android project source at commit de0b517,然后尝试 运行 示例项目 multiproject-same-dependencies 中的 android:package 任务。我收到这些错误:

[error] (b/android:apkbuild) This project cannot build APK, it has set 'libraryProject in Android := true'
[error] (c/android:apkbuild) This project cannot build APK, it has set 'libraryProject in Android := true'
[error] (d/android:apkbuild) This project cannot build APK, it has set 'libraryProject in Android := true'

我一直在关注这个项目的布局,试图用两个子模块构建我自己的 android 项目,但我遇到了同样的错误。一个子模块本身就是一个 android 库(我得到了一个错误),另一个只是一些没有 android 依赖项的 java 源。

我不知道这是否相关,但在我的系统上,示例项目不是开箱即用的。我做了这些更改:

我意识到可以通过在 ~/.sbt 中使用全局安装来避免这些更改,但我正在尝试模拟我的实际项目的设置,这些设置显式导入这些设置以使其更加独立和便携通过最小化环境依赖性。

这是我个人项目的build.sbt,如果有帮助的话:

val androidSettings = Seq(platformTarget := "android-15", dexMulti := true)

javacOptions in Compile ++= Seq("-source", "1.7", "-target", "1.7")

lazy val actionbarsherlock =
  project
    .settings(exportJars := true)
    .settings(androidBuildAar)
    .settings(androidSettings: _*)

lazy val util =
  project
    .settings(exportJars := true)

lazy val androminion =
  project
    .dependsOn(util)
    .androidBuildWith(actionbarsherlock)
    .settings(androidSettings: _*)
    .settings(exportJars := true)

libraryDependencies in actionbarsherlock ++= Seq(
  "com.android.support" % "support-v4" % "18.0.0"
)

这是定义依赖于另一个 android 项目和非 android 项目的 android 项目的惯用方式吗?

关于我的 java 安装:

$ java -version
java version "1.7.0_60"

谢谢!

你会运行

androminion/android:package