简体   繁体   中英

Google Play Service dependencies on android scala project

Is there any way to specify dependency for Android Play services on Scala SBT-Android project? I need to write app that receive Google Cloud Message.

I tried

  libraryDependencies ++= Seq(
    "com.actionbarsherlock" % "library" % "4.0.2" artifacts(Artifact("library", "apklib", "apklib")),
    "com.google.android.gms" % "play-services" % "3.2.65" artifacts(Artifact("play-services", "aar", "aar"))
  )

in Build.scala

But when I tried to build apk, SBT complains

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.google.android.gms#play-services;3.2.65: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency:     com.google.android.gms#play-    services;3.2.65: not found

Thanks in advance.

You have to install with the Android SDK tool, the "Google Repository" and maybe also the "Android Support Repository", in case, you use the appcompat library.

Hre is my setting in build.sbt:

libraryDependencies += aarlib("com.google.android.gms" % "play-services" % "4.+")

By the way, the android-sdk-plugin seems to be better maintained nowadays.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM