2013-11-23 155 views
1

我正在Scala開發類似Hello World的Android應用程序。未解決的依賴sbt-android 0.7.1-SNAPSHOT與sbt 0.13和Scala 2.10?

我在SBT-Android文檔中關注了the Getting Started tutorial,並嘗試應用Scala on Android書中的建議。一個從零開始做所有事情,g8 Geal/android-app

然而,在我面臨着同樣的錯誤兩種情況:

[warn] module not found: org.scala-sbt#sbt-android;0.7.1-SNAPSHOT 
[warn] ==== typesafe-ivy-releases: tried 
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-android/scala_2.10/sbt_0.13/0.7.1-SNAPSHOT/ivys/ivy.xml 
[warn] ==== sbt-plugin-releases: tried 
[warn] http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt-android/scala_2.10/sbt_0.13/0.7.1-SNAPSHOT/ivys/ivy.xml 
[warn] ==== local: tried 
[warn] /Users/jcarres/.ivy2/local/org.scala-sbt/sbt-android/scala_2.10/sbt_0.13/0.7.1-SNAPSHOT/ivys/ivy.xml 
[warn] ==== sbt-releases-repo: tried 
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-android/scala_2.10/sbt_0.13/0.7.1-SNAPSHOT/ivys/ivy.xml 
[warn] ==== sbt-plugins-repo: tried 
[warn] http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt-android/scala_2.10/sbt_0.13/0.7.1-SNAPSHOT/ivys/ivy.xml 
[warn] ==== maven-central: tried 
[warn] http://repo1.maven.org/maven2/org/scala-sbt/sbt-android_2.10_0.13/0.7.1-SNAPSHOT/sbt-android-0.7.1-SNAPSHOT.pom 
[warn] ==== scalasbt releases: tried 
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt-android/scala_2.10/sbt_0.13/0.7.1-SNAPSHOT/ivys/ivy.xml 
[info] Resolving org.fusesource.jansi#jansi;1.4 ... 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] ::   UNRESOLVED DEPENDENCIES   :: 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] :: org.scala-sbt#sbt-android;0.7.1-SNAPSHOT: not found 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 

我試過的sbt-android幾個版本,似乎問題是,我的Scala和SBT版本不匹配。

當我訪問http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt-android我只能看到scala_2.9.2目錄,而我的Scala版本是2.10。我的sbt版本是0.13,而它應該是0.12

是否需要刪除Scala 2.10並安裝Scala 2.9.2和/或將sbt降級爲0.12?有解決方案嗎?

回答

6

sbt使用它下載的Scala副本 - 它會自動下載「正確」版本 - 所以不需要搞亂你自己安裝的Scala副本。

因爲這是一個sbt插件,你將需要sbt版本改變,預計之一,在project/build.properties(如果這個文件不存在,你可以創建它,用下面的內容):

sbt.version=0.12.0 

確保你的reload sbt,以便新的(舊)版本的sbt被加載。

或者,當然,你可以嘗試從源代碼編譯爲sbt-android-plugin SBT 0.13,做相反的動作(你可能需要建立和publish-local一些依賴)。它可能工作。

+0

正是!它工作完美。非常感謝你 – user1565940

相關問題