我只是按照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?
我错过了什么?
答案 0 :(得分:8)
对于sbt 0.11.0:
rm -rvf project/plugins/
project/plugins.sbt
,此文件的内容为addSbtPlugin("org.scala-tools.sbt" % "sbt-android-plugin" % "0.6.0-SNAPSHOT")
sbt
android:package-debug
编译/打包创建的hello world程序g8。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
已经发布。)