{"action":"created","issue":{"url":"https://api.github.com/repos/pfn/android-sdk-plugin/issues/149","labels_url":"https://api.github.com/repos/pfn/android-sdk-plugin/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/pfn/android-sdk-plugin/issues/149/comments","events_url":"https://api.github.com/repos/pfn/android-sdk-plugin/issues/149/events","html_url":"https://github.com/pfn/android-sdk-plugin/issues/149","id":59621499,"number":149,"title":"NoClassDefFoundError: scala.collection.immutable.Nil$","user":{"login":"DavidPerezIngeniero","id":6008104,"avatar_url":"https://avatars.githubusercontent.com/u/6008104?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidPerezIngeniero","html_url":"https://github.com/DavidPerezIngeniero","followers_url":"https://api.github.com/users/DavidPerezIngeniero/followers","following_url":"https://api.github.com/users/DavidPerezIngeniero/following{/other_user}","gists_url":"https://api.github.com/users/DavidPerezIngeniero/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidPerezIngeniero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidPerezIngeniero/subscriptions","organizations_url":"https://api.github.com/users/DavidPerezIngeniero/orgs","repos_url":"https://api.github.com/users/DavidPerezIngeniero/repos","events_url":"https://api.github.com/users/DavidPerezIngeniero/events{/privacy}","received_events_url":"https://api.github.com/users/DavidPerezIngeniero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-03T10:20:05Z","updated_at":"2015-03-03T11:08:10Z","closed_at":null,"body":"I have a multiproject build.\r\n\r\nOne project is a Java app called `libstest`, that uses a library project called `biblsinterface` made with Java, and it uses another library called `BiblS` made with Scala.\r\n\r\nIt compiles ok, but when running, I get this error:\r\n```\r\njava.lang.NoClassDefFoundError: scala.collection.immutable.Nil$\r\n```\r\nI've added this to the project config:\r\n```scala\r\nproguardOptions in Android += \"-keep class scala.collection.immutable.Nil$\",\r\n```\r\nbut no success.\r\n\r\nHere is an excerpt of my `Build.scala`:\r\n```scala\r\n\tlazy val configComun = Seq(\r\n\t\tscalaVersion := \"2.11.5\",\r\n\t\tparallelExecution in Test := false,\r\n\t\tjavacOptions ++= Seq(\"-encoding\", \"UTF-8\"),\r\n\t\tplatformTarget in Android := \"android-19\",\r\n\t\ttypedResources in Android := false,\r\n\t\tsourcesInBase := false\r\n\t)\r\n\r\n\t/** Configuracion comun a todas las librerias. */\r\n\tlazy val configLib = android.Plugin.androidBuildAar ++ configComun ++ Seq(\r\n\t\texportJars := true\r\n\t)\r\n\r\n\t/** Configuracion comun a todas las aplicaciones. */\r\n\tlazy val configApl = configComun ++ Seq(\r\n\t\ttransitiveAndroidLibs in Android := false,\r\n\t\tproguardOptions in Android += proguardEstandar,\r\n\t\tpackageRelease <<= packageRelease in Android,\r\n\t\tpackageDebug <<= packageDebug in Android,\r\n\t\trun <<= run in Android,\r\n\t\tinstall <<= install in Android,\r\n\t\tjavacOptions ++= Seq(\"-source\", \"1.7\", \"-target\", \"1.7\"),\r\n\t\tjavacOptions in Compile <<= (javacOptions in Compile) map {\r\n\t\t\t_ collect {\r\n\t\t\t\tcase \"1.5\" => \"1.7\"\r\n\t\t\t\tcase s => s\r\n\t\t\t}\r\n\t\t},\r\n\t\t// Al compilar tests, añadir el classpath normal\r\n\t\tmanagedClasspath in Test <++= (platformJars in Android, baseDirectory) map {\r\n\t\t\tcase ((j, _), b) =>\r\n\t\t\t\tSeq(Attributed.blank(b / \"bin\" / \"classes\"), Attributed.blank(file(j)))\r\n\t\t},\r\n\t\t// Da problemas engordar .apk con librerias test\r\n\t\tdebugIncludesTests in Android := false,\r\n\t\tdexMaxHeap in Android := \"8192m\",\r\n\t)\r\n\r\n\t/** Configuracion comun a todas las aplicaciones Scala. */\r\n\tlazy val configScala = configApl ++ Seq(\r\n\t\t//apkbuildExcludes in Android := true,\r\n\t\t//debugIncludesTests in Android := false,\r\n\t\tuseProguard in Android := true,\r\n\t\tproguardOptions in Android += proguardScala,\r\n\t\tscalacOptions in Compile += \"-feature\",\r\n\t\tscalacOptions in(Compile, compile) ++= Seq(\r\n\t\t\t\"-target:jvm-1.7\"\r\n\t\t),\r\n\t\tproguardCache in Android ++= Seq(\r\n\t\t\tProguardCache(\"org.scaloid\") % \"org.scaloid\"\r\n\t\t),\r\n\t\tlibraryDependencies ++= Seq(\r\n\t\t\t\"org.scala-lang\" % \"scala-library\" % scalaVersion.value,\r\n\t\t\tscaloid\r\n\t\t)\r\n\t)\r\n\r\n\tlazy val BiblS = project.settings(\r\n\t\tconfigLib ++ Seq(\r\n\t\t\texportJars in Test := false,\r\n\t\t\t// https://github.com/pfn/android-sdk-plugin/issues/88\r\n\t\t\tsourceGenerators in Compile := Seq((sourceGenerators in Compile).value.last),\r\n\t\t\t// Hace falta para poder lanzar tests de Robolectric\r\n\t\t\tunmanagedClasspath in Test := ((builder in Android).value.getBootClasspath map Attributed.blank) ++ (unmanagedClasspath in Test).value,\r\n\t\t\t// Si no lo hacemos tendremos este problema: https://groups.google.com/forum/#!topic/scala-on-android/Z4aUbYBYrE4\r\n\t\t\tfork in Test := true,\r\n\t\t\tlibraryDependencies ++= Seq(\r\n\t\t\t\tscaloid,\r\n\t\t\t\tsupport\r\n\t\t\t),\r\n\t\t): _*\r\n\t)\r\n\r\n\tlazy val biblsinterface = project.androidBuildWith(BiblS).settings(\r\n\t\tconfigLib ++ Seq(\r\n\t\t): _*\r\n\t)\r\n\r\n\tlazy val libstest = project.androidBuildWith(biblsinterface).settings(\r\n\t\tconfigScala ++ Seq(\r\n\t\t\tproguardOptions in Android += \"-keep class scala.collection.immutable.Nil$\",\r\n\t\t\t\tlibraryDependencies ++= Seq(\r\n\t\t\t\t\"com.android.support\" % \"support-v4\" % \"19.1.0\",\r\n\t\t\t\t\"com.android.support\" % \"recyclerview-v7\" % \"21.0.3\"\r\n\t\t\t)\r\n\t\t): _*\r\n\t)\r\n```"},"comment":{"url":"https://api.github.com/repos/pfn/android-sdk-plugin/issues/comments/76926530","html_url":"https://github.com/pfn/android-sdk-plugin/issues/149#issuecomment-76926530","issue_url":"https://api.github.com/repos/pfn/android-sdk-plugin/issues/149","id":76926530,"user":{"login":"pfn","id":512197,"avatar_url":"https://avatars.githubusercontent.com/u/512197?v=3","gravatar_id":"","url":"https://api.github.com/users/pfn","html_url":"https://github.com/pfn","followers_url":"https://api.github.com/users/pfn/followers","following_url":"https://api.github.com/users/pfn/following{/other_user}","gists_url":"https://api.github.com/users/pfn/gists{/gist_id}","starred_url":"https://api.github.com/users/pfn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfn/subscriptions","organizations_url":"https://api.github.com/users/pfn/orgs","repos_url":"https://api.github.com/users/pfn/repos","events_url":"https://api.github.com/users/pfn/events{/privacy}","received_events_url":"https://api.github.com/users/pfn/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T11:08:10Z","updated_at":"2015-03-03T11:08:10Z","body":"Since your consuming project is java, you must set `proguardScala in Android := true`"}}