Hi,
I've read in the documentation of android-sdk-plugin,
that androidBuildWith() is the new recommended way of including
dependencies.
There is no detailed documentation.
I've tried this:
object Build extends android.AutoBuild {
lazy val IncidenciasS = project.settings(
configScala ++ Seq(
transitiveAndroidLibs in Android := false,
libraryDependencies ++= Seq(
support
)
): _*
).androidBuildWith(BiblS)
/**Biblioteca Scala, contiene codigo generico y el de sincronizacion.*/
lazy val BiblS = project.settings(
configLib ++ Seq(
exportJars in Test := false,
scalaVersion := "2.10.4",
libraryDependencies ++= Seq(
scaloid,
support
)
): _*
)
lazy val configComun = Seq(
platformTarget in Android := "android-19",
sourcesInBase := false
)
lazy val configLib = android.Plugin.androidBuildApklib ++ configComun ++
Seq(
exportJars := true
)
lazy val configApl = configComun ++ Seq(
useProguard in Android := true,
proguardOptions in Android += proguardEstandar,
packageRelease <<= packageRelease in Android,
packageDebug <<= packageDebug in Android,
run <<= run in Android,
install <<= install in Android,
javacOptions ++= Seq("-source", "1.7", "-target", "1.7"),
javacOptions in Compile <<= (javacOptions in Compile) map { _ collect {
case "1.5" => "1.7"
case s => s
}
},
managedClasspath in Test <++= (platformJars in Android, baseDirectory) map {
case ((j,_), b) =>
Seq(Attributed.blank(b / "bin" / "classes"), Attributed.blank(file(j)))
},
// Da problemas engordar .apk con librerias test
debugIncludesTests in Android := false,
dexMaxHeap in Android := "8192m",
)
//=============================Librerias usadas muy a menudo
val scaloid = "org.scaloid" %% "scaloid" % "3.2.1-8"
val support = "com.android.support" % "appcompat-v7" % "19.1.0"
}
But then SBT complains that:
java.lang.RuntimeException: configure project.properties or set
'platformTarget in Android'
at scala.sys.package$.error(package.scala:27)
at
android.Plugin$$anonfun$allPluginSettings$74$$anonfun$apply$36.apply(rules.scala:432)
at
android.Plugin$$anonfun$allPluginSettings$74$$anonfun$apply$36.apply(rules.scala:432)
If I use instead:
lazy val IncidenciasS = project.settings(
android.Plugin.androidBuild(BiblS) ++ configScala ++ Seq(
transitiveAndroidLibs in Android := false,
libraryDependencies ++= Seq(
support
)
): _*
).dependsOn(BiblS)
Then it complains that
[info] Processing resources
[trace] Stack trace suppressed: run last IncidenciasS/android:rGenerator
for the full output.
[error] (IncidenciasS/android:rGenerator) Error: more than one library with
package name 'android.support.v7.appcompat'
[error] You can temporarily disable this error with
android.enforceUniquePackageName=false
[error] However, this is temporary and will be enforced in 1.0
The error messages are not too self-explanatory for me.
Keep in mind that I've used transitiveAndroidLibs in Android := false
Any help please?
--
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.