未解决的sbt-android-plugin 0.6.0-SNAPSHOT依赖?

时间:2011-09-26 21:46:08

标签: android scala sbt sbt-android-plugin

我只是按照Build Scala Android apps using Scala的步骤操作,当我在项目文件夹中运行sbt时,我得到了以下未解决的依赖项错误:

[info] Loading project definition from /Users/macarse/Documents/scalatest/project/plugins
[info] Updating {file:/Users/macarse/Documents/scalatest/project/plugins/}default-dd299a...
[warn]  module not found: org.scala-tools.sbt#sbt-android-plugin_2.9.1;0.6.0-SNAPSHOT
[warn] ==== typesafe-ivy-releases: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-android-plugin_2.9.1/0.6.0-SNAPSHOT/ivys/ivy.xml
[warn]   -- artifact org.scala-tools.sbt#sbt-android-plugin_2.9.1;0.6.0-SNAPSHOT!sbt-android-plugin_2.9.1.jar:
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-android-plugin_2.9.1/0.6.0-SNAPSHOT/jars/sbt-android-plugin_2.9.1.jar
[warn] ==== local: tried
[warn]   /Users/macarse/.ivy2/local/org.scala-tools.sbt/sbt-android-plugin_2.9.1/0.6.0-SNAPSHOT/ivys/ivy.xml
[warn]   -- artifact org.scala-tools.sbt#sbt-android-plugin_2.9.1;0.6.0-SNAPSHOT!sbt-android-plugin_2.9.1.jar:
[warn]   /Users/macarse/.ivy2/local/org.scala-tools.sbt/sbt-android-plugin_2.9.1/0.6.0-SNAPSHOT/jars/sbt-android-plugin_2.9.1.jar
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/scala-tools/sbt/sbt-android-plugin_2.9.1/0.6.0-SNAPSHOT/sbt-android-plugin_2.9.1-0.6.0-SNAPSHOT.pom
[warn]   -- artifact org.scala-tools.sbt#sbt-android-plugin_2.9.1;0.6.0-SNAPSHOT!sbt-android-plugin_2.9.1.jar:
[warn]   http://repo1.maven.org/maven2/org/scala-tools/sbt/sbt-android-plugin_2.9.1/0.6.0-SNAPSHOT/sbt-android-plugin_2.9.1-0.6.0-SNAPSHOT.jar
[warn] ==== Scala-Tools Maven2 Repository: tried
[warn]   http://scala-tools.org/repo-releases/org/scala-tools/sbt/sbt-android-plugin_2.9.1/0.6.0-SNAPSHOT/sbt-android-plugin_2.9.1-0.6.0-SNAPSHOT.pom
[warn]   -- artifact org.scala-tools.sbt#sbt-android-plugin_2.9.1;0.6.0-SNAPSHOT!sbt-android-plugin_2.9.1.jar:
[warn]   http://scala-tools.org/repo-releases/org/scala-tools/sbt/sbt-android-plugin_2.9.1/0.6.0-SNAPSHOT/sbt-android-plugin_2.9.1-0.6.0-SNAPSHOT.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scala-tools.sbt#sbt-android-plugin_2.9.1;0.6.0-SNAPSHOT: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/macarse/Documents/scalatest/project/plugins/}default-dd299a/*:update: sbt.ResolveException: unresolved dependency: org.scala-tools.sbt#sbt-android-plugin_2.9.1;0.6.0-SNAPSHOT: not found
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

我错过了什么?

2 个答案:

答案 0 :(得分:8)

对于sbt 0.11.0:

  1. 按照@Debilski's answer的说明将android-plugin发布到本地。
  2. rm -rvf project/plugins/
  3. 创建文件project/plugins.sbt,此文件的内容为addSbtPlugin("org.scala-tools.sbt" % "sbt-android-plugin" % "0.6.0-SNAPSHOT")
  4. 现在您应该能够在该项目下运行sbt
  5. android:package-debug编译/打包创建的hello world程序g8。
  6. android:install-device在Android设备上安装APK。

答案 1 :(得分:3)

sbt-android-plugin尚未在版本0.6.0-SNAPSHOT中公开。快速解决方法是在本地安装它。

git clone https://github.com/jberkel/android-plugin.git 
cd android-plugin
sbt update
sbt publish-local

当然,只有github存储库的主分支指向版本0.6.0-SNAPSHOT时,这才有效。 (如果它不再存在,那么我可能会怀疑0.6.0已经发布。)