I am trying to create a project with two sub-projects: one of them is an
apklib, the other one uses it (in the future, more applications will make
use of this library). The library has some string resources, and the
library contains an activity that references them.

My project/Build.scala looks like this:

import sbt._import sbt.Keys._import android.Keys._import
android.Dependencies.LibraryProject
object DropBuild extends Build {

  lazy val commonSettings = Seq(
    scalaVersion := "2.10.4",
    version := "0.1",
    scalacOptions := Seq(
      "-target:jvm-1.6", "-deprecation", "-feature"
    ),
    javacOptions ++= Seq(
      "-source", "1.6",
      "-target", "1.6"),
    proguardCache in Android ++= Seq(ProguardCache("org.scaloid") %
"org.scaloid"),
    proguardOptions in Android ++= Seq("-dontobfuscate", "-dontoptimize"),
    libraryDependencies ++= Seq("org.scaloid" %% "scaloid" % "3.1-8-RC1",
                "org.scala-lang" % "scala-library" % "2.10.1")
  )

  lazy val appSettings = android.Plugin.androidBuild(dropapi) ++
    Seq(
      localProjects in Android += LibraryProject(dropapi.base),
      run <<= run in Android,
      install <<= install in Android
    )

  override lazy val settings = super.settings :+ {
    shellPrompt := {
      s => Project.extract(s).currentProject.id + "> "
    }
  }

  lazy val root = Project("root", file("."))
    .aggregate(dropapi, dropscanner)

  lazy val dropapi = Project("dropapi", file("DropAPI"))
    .settings(android.Plugin.androidBuildApklib: _*)
    .settings(commonSettings: _*)
    .settings(name := "dropapi",
          organization := "rose.dropsnroses.api")

  lazy val dropscanner = Project("dropscanner", file("DropScanner"))
    .settings(commonSettings: _*)
    .settings(appSettings: _*)
    .settings(name := "DropScanner",
          organization := "rose.dropsnroses.dropscanner"
          )
    .dependsOn(dropapi)
}

However, it looks like the resources are not merged properly, as the
strings defined in the library (dropapi) cause a “resource not found”
exception:

E/AndroidRuntime(22370): FATAL EXCEPTION: main
E/AndroidRuntime(22370): Process: rose.dropsnroses, PID: 22370
E/AndroidRuntime(22370):
android.content.res.Resources$NotFoundException: String resource ID
#0x7f020008
E/AndroidRuntime(22370):     at
android.content.res.Resources.getText(Resources.java:255)

Any idea of what could be wrong? Is there anything else to do in order to
use the resources from the library into the application?
  Sam

-- 
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.

Reply via email to