androidscalasbtsbt-android-plugin

Unresolved dependency on sbt-android 0.7.1-SNAPSHOT with sbt 0.13 and Scala 2.10?


I'm developing a Hello World-like Android application in Scala.

I have followed the Getting Started tutorial in the SBT-Android documentation and also tried applying the recommendations from the Scala on Android book. One does everything from scratch the other does g8 Geal/android-app.

In both cases however I'm facing the same error:

[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]  ::::::::::::::::::::::::::::::::::::::::::::::

I've tried several versions of sbt-android and it seems that the problem is that my Scala and sbt versions do not match.

When I visit http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt-android I can only see the scala_2.9.2 directory while my version of Scala is 2.10. My version of sbt is 0.13 while it seems it should be 0.12.

Do I need to delete Scala 2.10 and install Scala 2.9.2 and/or downgrade sbt to 0.12? Is there a solution?


Solution

  • sbt uses a copy of Scala that it downloads itself - it will automatically download the "right" version - so there is no need to mess around with your own installed copy of Scala.

    Because this is a sbt plugin you will need to change the sbt version to the one it expects, in project/build.properties (if this file does not exist, you can just create it, with the following contents):

    sbt.version=0.12.0
    

    Make sure you reload sbt, so that the new (old) version of sbt gets loaded.

    Alternatively, of course, you could try to compile sbt-android-plugin from source for sbt 0.13, by doing the opposite manoeuvre (you might need to build and publish-local some of its dependencies). It might work.