errr...sorry, I need to restart sbt console after update the .sbt file.
Shen Xi about.me/davidshen [image: Shen Xi on about.me] <http://about.me/davidshen>https://twitter.com/#!/davidshen84 On Thu, May 22, 2014 at 1:29 PM, Xi Shen <[email protected]> wrote: > OK, thanks. Do I have to use method in a build.scala file? I have tried > both in .sbt file, none works :(. I am using sbt 0.13 > > > Shen Xi > about.me/davidshen > [image: Shen Xi on about.me] > <http://about.me/davidshen>https://twitter.com/#!/davidshen84 > > > On Thu, May 22, 2014 at 10:41 AM, Nick Stanchenko > <[email protected]>wrote: > >> Oops, I meant for sbt 0.12. For 0.13 you can probably use something like >> (untested): >> >> unmanagedClasspath in Compile := (unmanagedClasspath in Compile).value >> filterNot (_.data.getName == "android-support-v4.jar") >> >> >> On Thursday, May 22, 2014 3:40:16 AM UTC+1, Nick Stanchenko wrote: >>> >>> Have you read at the bottom of that link? There is a solution precisely >>> for that problem that works for me :) >>> Copying here for your convenience (for sbt 0.13): >>> >>> unmanagedClasspath in Compile <<= (unmanagedClasspath in Compile) map { cp >>> => >>> cp filterNot (_.data.getName == "android-support-v4.jar")} >>> >>> >>> On Thursday, May 22, 2014 3:36:38 AM UTC+1, Xi Shen wrote: >>>> >>>> Hi Nick, >>>> >>>> Thanks. But I think I have tried that method at the first place, and it >>>> doesn't work. The tricky thing about this "com.viewpagerindicator" package >>>> is that, it included a file in its package by the path >>>> libs/android-support-v4.jar. Looing inside of the jar file, it is the >>>> support-v4 package, but a very old version. I think the "exclude" function >>>> cannot exclude the files that are in the package. Maybe there are ways to >>>> exclude files from a package too? Please help me. >>>> >>>> >>>> Shen Xi >>>> about.me/davidshen >>>> [image: Shen Xi on about.me] >>>> <http://about.me/davidshen>https://twitter.com/#!/davidshen84 >>>> >>>> >>>> On Wed, May 21, 2014 at 2:58 PM, Nick Stanchenko <[email protected]>wrote: >>>> >>>>> By the way, as you will perhaps find in the linked issue, the correct >>>>> sbt way to exclude dependencies (transitive managed ones, not >>>>> jar-hardcoded >>>>> ones like in this case) is: >>>>> >>>>> ("org" % "package" % "version") exclude ("org", "package") >>>>> >>>>> The provided scope means “do not include this library into my >>>>> artifact, I rely on the consumer of my artifact to include it”. >>>>> >>>>> N >>>>> >>>>> On Wednesday, May 21, 2014 7:17:32 AM UTC+1, Xi Shen wrote: >>>>> >>>>>> I think it is because the "viewpagerindicator" package included a >>>>>> wrong version of support-v4. I tried to exclude the dependencies of this >>>>>> package by: >>>>>> >>>>>> "com.viewpagerindicator" % "library" % "2.4.1" % "provided", >>>>>> >>>>>> >>>>>> But it cannot be excluded, and "sbt compile --debug" shows: >>>>>> >>>>>> ...\app\target\apklibs\com.viewpagerindicator-library-2.4.1\ >>>>>> libs\android-support-v4.jar;... >>>>>> >>>>>> >>>>>> And it is ahead of the corrected support-v4. How can I fix this? >>>>>> >>>>>> >>>>>> On Wednesday, May 21, 2014 12:05:27 PM UTC+8, Xi Shen wrote: >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> My project was build by Android Studio and uses the Gradle build >>>>>>> system. The project can build correctly with Gradle. Now I want to add >>>>>>> Scala support into it. When I ran "sbt compile", I got the following >>>>>>> error: >>>>>>> >>>>>>> [error] /path/to/my/project/file.java:182: cannot find symbol >>>>>>> [error] symbol : method getActionProvider(android.view.MenuItem) >>>>>>> [error] location: class android.support.v4.view.MenuItemCompat >>>>>>> [error] MenuItemCompat.getActionProvider(item); >>>>>>> [error] ^ >>>>>>> >>>>>>> >>>>>>> My entire *build.sbt* file: >>>>>>> >>>>>>> import sbt._ >>>>>>> import sbt.Keys._ >>>>>>> >>>>>>> import android.Keys._ >>>>>>> import android.Dependencies.{apklib,aar} >>>>>>> >>>>>>> >>>>>>> android.Plugin.androidBuild >>>>>>> >>>>>>> platformTarget in Android := "android-19" >>>>>>> >>>>>>> minSdkVersion in Android := 9 >>>>>>> >>>>>>> targetSdkVersion in Android := 19 >>>>>>> >>>>>>> name := "app" >>>>>>> >>>>>>> version := "1.0" >>>>>>> >>>>>>> scalaVersion := "2.10.3" >>>>>>> >>>>>>> libraryDependencies ++= Seq( >>>>>>> *"com.android.support" % "support-v4" % "19.1.0",* >>>>>>> aar("com.android.support" % "appcompat-v7" % "19.1.0"), >>>>>>> "com.nostra13.universalimageloader" % "universal-image-loader" % >>>>>>> "1.9.1", >>>>>>> apklib("com.viewpagerindicator" % "library" % "2.4.1"), >>>>>>> "com.google.guava" % "guava" % "17.0", >>>>>>> "com.squareup" % "otto" % "1.3.4", >>>>>>> aar("com.github.castorflex.smoothprogressbar" % "library" % >>>>>>> "0.5.1"), >>>>>>> aar("com.github.chrisbanes.actionbarpulltorefresh" % "library" % >>>>>>> "0.9.9"), >>>>>>> aar("com.github.chrisbanes.actionbarpulltorefresh" % "extra-abc" >>>>>>> % "0.9.9"), >>>>>>> aar("com.github.chrisbanes.photoview" % "library" % "1.2.3"), >>>>>>> "org.jsoup" % "jsoup" % "1.7.3", >>>>>>> "com.google.oauth-client" % "google-oauth-client" % "1.17.0-rc", >>>>>>> "com.google.http-client" % "google-http-client-jackson2" % >>>>>>> "1.18.0-rc", >>>>>>> "com.google.inject" % "guice" % "3.0" classifier "no_aop", >>>>>>> aar("com.google.android.gms" % "play-services" % "4.3.23")) >>>>>>> >>>>>>> javacOptions in Compile += "-deprecation" >>>>>>> >>>>>>> scalacOptions in Compile += "-deprecation" >>>>>>> >>>>>>> >>>>>>> This is a single project. So I only have one build.sbt, no >>>>>>> build.scala file. I guess this is fine? >>>>>>> >>>>>>> >>>>>>> Thank you, >>>>>>> David >>>>>>> >>>>>>> >>>>>> -- >>>>> You received this message because you are subscribed to a topic in the >>>>> Google Groups "scala-on-android" group. >>>>> To unsubscribe from this topic, visit https://groups.google.com/d/ >>>>> topic/scala-on-android/yoEprF922wY/unsubscribe. >>>>> To unsubscribe from this group and all its topics, send an email to >>>>> [email protected]. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "scala-on-android" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/scala-on-android/yoEprF922wY/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "scala-on-android" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
