scala-android / sbt-android

An easy-to-use sbt plugin for working with all Android projects
Other
742 stars 94 forks source link

GC overhead limit exceeded #218

Closed tealsoftware closed 9 years ago

tealsoftware commented 9 years ago

After upgrade to latest library and plugin versions (including android-sdk-plugin 1.5.6) I'm getting "GC overhead limit exceeded" at Proguard.

I've tried the following.

Increasing dexMaxHeap:

 dexMaxHeap in Android := "8192m"

Adding more packages to proguardCache:

proguardCache in Android ++= Seq(
  "com.typesafe.slick",
  "org.scaloid",
  "org.macroid",
  "com.google",
  "io.spray"
)

Trying to give SBT/Java/something more memory:

val buildSettings = Defaults.defaultSettings ++ Seq(
  javaOptions += "-Xmx8G"
)

Switching to newer Proguard in projects/proguard.sbt (tried both 5.1 and 5.2.1):

libraryDependencies += "net.sf.proguard" % "proguard-base" % "5.2.1"

I'm watching the Task Manager and the java process never exceeds 700 MB (and there's plenty to spare). I'm at SBT version 0.13.9 and Scala version 2.11.7.

Output log starting from when ProGuard kicks in:

ProGuard, version 5.2.1
ProGuard is released under the GNU General Public License. You therefore
must ensure that programs that link to it (android, ...)
carry the GNU General Public License as well. Alternatively, you can
apply for an exception with the author of ProGuard.
Reading input...
Reading program jar [C:\Users\Myself\.ivy2\cache\org.scala-lang\scala-reflect\jars\scala-reflect-2.11.7.jar] (filtered)
Reading program jar [C:\projects\myapp\android\target\android\intermediates\aars\com.google.android.gms-play-services-4.4.52\com.google.android.
gms-play-services-4.4.52.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.scala-lang\scala-compiler\jars\scala-compiler-2.11.0.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.slf4j\slf4j-api\jars\slf4j-api-1.7.12.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\com.typesafe.slick\slick_2.11\jars\slick_2.11-2.1.0.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.slf4j\slf4j-nop\jars\slf4j-nop-1.7.12.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\com.splunk.mint\mint\jars\mint-4.4.0.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\io.spray\spray-json_2.11\jars\spray-json_2.11-1.3.2.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\com.squareup.okio\okio\jars\okio-1.6.0.jar] (filtered)
Reading program jar [C:\projects\myapp\android\target\android\intermediates\aars\com.android.support-support-v4-22.1.1\com.android.support-suppo
rt-v4-22.1.1.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.scala-lang.modules\scala-async_2.11\bundles\scala-async_2.11-0.9.2.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.brianmckenna\wartremover_2.11\jars\wartremover_2.11-0.10.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.11.7.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\com.github.nscala-time\nscala-time_2.11\jars\nscala-time_2.11-2.2.0.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.joda\joda-convert\jars\joda-convert-1.2.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\com.typesafe\config\bundles\config-1.2.1.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\com.squareup.okhttp\okhttp\jars\okhttp-2.5.0.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.sqldroid\sqldroid\jars\sqldroid-1.0.3.jar] (filtered)
Reading program jar [C:\dev\android\extras\android\m2repository\com\android\support\support-annotations\22.1.1\support-annotations-22.1.1.jar] (filter
ed)
Reading program jar [C:\projects\myapp\android\target\android\intermediates\aars\org.macroid-macroid_2.11-2.0.0-M4\org.macroid-macroid_2.11-2.0.
0-M4.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.scaloid\scaloid_2.11\jars\scaloid_2.11-4.0.jar] (filtered)
Reading program jar [C:\projects\myapp\android\target\android\intermediates\aars\com.android.support-support-v4-22.1.1\libs\internal_impl-22.1.1
.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.scala-lang.modules\scala-xml_2.11\bundles\scala-xml_2.11-1.0.1.jar] (filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\org.scala-lang.modules\scala-parser-combinators_2.11\bundles\scala-parser-combinators_2.11-1.0.1.jar]
(filtered)
Reading program jar [C:\Users\Myself\.ivy2\cache\joda-time\joda-time\jars\joda-time-2.8.2.jar] (filtered)
Reading program jar [C:\projects\myapp\android\target\android\intermediates\classes.jar] (filtered)
Reading library jar [C:\dev\android\platforms\android-23\android.jar]
Reading library jar [C:\dev\android\platforms\android-23\optional\org.apache.http.legacy.jar]
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [android.net.http.SslError]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: there were 7 duplicate class definitions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Initializing...
Note: the configuration refers to the unknown class 'Object'
      Maybe you meant the fully qualified name 'scala.tools.nsc.doc.model.Object'?
      Maybe you meant the fully qualified name 'java.lang.Object'?
Note: scala.tools.nsc.typechecker.TypeStrings$class calls 'Class.getEnclosingClass'
Warning: com.google.android.gms.common.GooglePlayServicesUtil: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang
.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: org.scaloid.common.TraitWebView$class: can't find referenced method 'int getVisibleTitleHeight()' in library class android.webkit.WebView
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:188)
        at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala:188)
        at sbt.Execute.next$1(Execute.scala:83)
        at sbt.Execute.processAll(Execute.scala:86)
        at sbt.Execute.runKeep(Execute.scala:66)
        at sbt.EvaluateTask$.liftedTree1$1(EvaluateTask.scala:359)
        at sbt.EvaluateTask$.run$1(EvaluateTask.scala:358)
        at sbt.EvaluateTask$.runTask(EvaluateTask.scala:378)
        at sbt.Aggregation$$anonfun$3.apply(Aggregation.scala:64)
        at sbt.Aggregation$$anonfun$3.apply(Aggregation.scala:62)
        at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:314)
        at sbt.Aggregation$.timedRun(Aggregation.scala:62)
        at sbt.Aggregation$.runTasks(Aggregation.scala:71)
        at sbt.Aggregation$$anonfun$applyDynamicTasks$1.apply(Aggregation.scala:112)
        at sbt.Aggregation$$anonfun$applyDynamicTasks$1.apply(Aggregation.scala:110)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
        at sbt.Act$$anonfun$sbt$Act$$actParser0$1$$anonfun$sbt$Act$$anonfun$$evaluate$1$1$$anonfun$apply$10.apply(Act.scala:244)
        at sbt.Act$$anonfun$sbt$Act$$actParser0$1$$anonfun$sbt$Act$$anonfun$$evaluate$1$1$$anonfun$apply$10.apply(Act.scala:241)
        at sbt.Command$.process(Command.scala:93)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
        at sbt.State$$anon$1.process(State.scala:184)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.MainLoop$.next(MainLoop.scala:98)
        at sbt.MainLoop$.run(MainLoop.scala:91)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65)
        at sbt.Using.apply(Using.scala:24)
        at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65)
        at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48)
        at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32)
        at sbt.MainLoop$.runLogged(MainLoop.scala:24)
        at sbt.StandardMain$.runManaged(Main.scala:53)
        at sbt.xMain.run(Main.scala:28)
        at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
        at xsbt.boot.Launch$.run(Launch.scala:109)
        at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
        at xsbt.boot.Launch$.launch(Launch.scala:117)
        at xsbt.boot.Launch$.apply(Launch.scala:18)
        at xsbt.boot.Boot$.runImpl(Boot.scala:41)
        at xsbt.boot.Boot$.main(Boot.scala:17)
        at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
        at proguard.classfile.constant.Utf8Constant.getStringRepresentation(Utf8Constant.java:251)
        at proguard.classfile.constant.Utf8Constant.switchToStringRepresentation(Utf8Constant.java:174)
        at proguard.classfile.constant.Utf8Constant.getString(Utf8Constant.java:128)
        at proguard.classfile.ProgramClass.getString(ProgramClass.java:116)
        at proguard.classfile.ProgramMember.getName(ProgramMember.java:115)
        at proguard.classfile.ProgramClass.findMethod(ProgramClass.java:345)
        at proguard.classfile.ProgramClass.methodAccept(ProgramClass.java:523)
        at proguard.classfile.visitor.NamedMethodVisitor.visitProgramClass(NamedMethodVisitor.java:53)
        at proguard.classfile.ProgramClass.accept(ProgramClass.java:358)
        at proguard.classfile.ProgramClass.hierarchyAccept(ProgramClass.java:371)
        at proguard.classfile.util.MemberFinder.findMember(MemberFinder.java:86)
        at proguard.classfile.util.ClassReferenceInitializer.visitAnyRefConstant(ClassReferenceInitializer.java:212)
        at proguard.classfile.util.SimplifiedVisitor.visitAnyMethodrefConstant(SimplifiedVisitor.java:193)
        at proguard.classfile.util.SimplifiedVisitor.visitMethodrefConstant(SimplifiedVisitor.java:205)
        at proguard.classfile.constant.MethodrefConstant.accept(MethodrefConstant.java:69)
        at proguard.classfile.ProgramClass.constantPoolEntriesAccept(ProgramClass.java:457)
        at proguard.classfile.util.ClassReferenceInitializer.visitProgramClass(ClassReferenceInitializer.java:100)
        at proguard.classfile.ProgramClass.accept(ProgramClass.java:358)
        at proguard.classfile.ClassPool.classesAccept(ClassPool.java:124)
        at proguard.Initializer.execute(Initializer.java:146)
        at proguard.ProGuard.initialize(ProGuard.java:233)
        at proguard.ProGuard.execute(ProGuard.java:98)
        at android.Proguard$.proguard(proguard.scala:169)
        at android.Tasks$$anonfun$72.apply(tasks.scala:1031)
        at android.Tasks$$anonfun$72.apply(tasks.scala:1029)
        at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:35)
        at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:34)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
[error] Use 'last' for the full log.

BTW at the very start I'm getting a strange warning:

[warn] Multiple resolvers having different access mechanism configured with same name 'jcenter'. To avoid conflict, Remove duplicate project resolvers
 (`resolvers`) or rename publishing resolver (`publishTo`).

build.sbt looks like this:

import android.Keys._
import android.Dependencies.aar
import sbt.Keys._
import android.PromptPasswordsSigningConfig

android.Plugin.androidBuild

val buildSettings = Defaults.defaultSettings ++ Seq(
  javaOptions += "-Xmx8G"
)

platformTarget in Android := "android-23"

name := myapp-forms"

scalaVersion := "2.11.7"

run <<= run in Android

install <<= install in Android

resolvers ++= Seq(
  Resolver.sonatypeRepo("releases"),
  "jcenter" at "http://jcenter.bintray.com",
  "jbrechtel snapshots" at "http://jbrechtel.github.com/repo/snapshots",
  "scala tools snapshots" at "http://scala-tools.org/repo-snapshots",
  "scala tools releases" at "http://scala-tools.org/repo-releases",
  "bintray/non" at "http://dl.bintray.com/non/maven",
  "splunk" at "https://mint.splunk.com/gradle/"
)

resolvers ++= Seq("snapshots", "releases").map(Resolver.sonatypeRepo)

dexMaxHeap in Android := "8192m"

scalacOptions += "-feature"

scalacOptions ++= Seq("-unchecked", "-deprecation") // for Robospecs

scalacOptions in Test ++= Seq("-Yrangepos") // for Specs2

libraryDependencies ++= Seq(
  aar("org.macroid" %% "macroid" % "2.0.0-M4"),
  "com.google.android.gms" % "play-services" % "4.4.52",
  "com.android.support" % "support-v4" % "22.1.1",
  "com.typesafe.slick" %% "slick" % "2.1.0" withSources() withJavadoc(), 
  "org.slf4j" % "slf4j-nop" % "1.7.12" withSources() withJavadoc(),
  "com.github.nscala-time" %% "nscala-time" % "2.2.0" withSources() withJavadoc(),
  "io.spray" %%  "spray-json" % "1.3.2" withSources() withJavadoc(),
  "com.squareup.okhttp" % "okhttp" % "2.5.0" withSources() withJavadoc(),
  "org.scaloid" %% "scaloid" % "4.0" withSources() withJavadoc(),
  "org.sqldroid" % "sqldroid" % "1.0.3" withSources() withJavadoc(),
  "com.splunk.mint" % "mint" % "4.4.0" withSources() withJavadoc(), 
  "org.scalatest" % "scalatest_2.11" % "2.2.5" % "test" withSources() withJavadoc()
)

proguardScala in Android := true

proguardOptions in Android ++= Seq(
  "-dontobfuscate",
  "-dontoptimize",
  "-ignorewarnings",
  "-keepattributes Signature",
  "-dontwarn scala.collection.**", // required from Scala 2.11.3
  "-dontwarn scala.collection.mutable.**", // required from Scala 2.11.0
  "-dontwarn javax.naming.InitialContext",
  "-dontnote org.slf4j.**",
  "-keep class scala.Dynamic",
  "-keep class myapp.**",
  "-keep class scala.collection.Seq.**",
  "-keep public class org.sqldroid.**",
  "-keep class scala.concurrent.Future$.**",
  "-keep class scala.slick.lifted.**",
  "-keep class scala.slick.jdbc.meta.**",
  "-keep class scala.slick.driver.JdbcProfile$Implicits",
  "-keep class org.scaloid.**",
  "-keep class org.scaloid.common.Logger",
  "-keep class scala.concurrent.Future",
  "-keep class macroid.**",
  "-keep class com.squareup.okhttp.**",
  "-keep class com.splunk.** { *; }"
)

proguardCache in Android ++= Seq(
  "com.typesafe.slick",
  "org.scaloid",
  "org.macroid",
  "com.google",
  "io.spray"
)

net.virtualvoid.sbt.graph.Plugin.graphSettings

packagingOptions in Android := PackagingOptions(excludes = Seq(
  "META-INF/LICENSE",
  "META-INF/LICENSE.txt",
  "META-INF/NOTICE",
  "META-INF/NOTICE.txt"
))

parallelExecution in Test := false

Any ideas? How can I force it to use the memory?

pfn commented 9 years ago

You need to increase the heap for sbt itself, JAVA_OPTS=-Xmx... sbt

Sent from my phone On Oct 25, 2015 11:58 AM, "tealsoftware" notifications@github.com wrote:

After upgrade to latest library and plugin versions (including android-sdk-plugin 1.5.6) I'm getting "GC overhead limit exceeded" at Proguard.

I've tried the following.

Increasing dexMaxHeap:

dexMaxHeap in Android := "8192m"

Adding more packages to proguardCache:

proguardCache in Android ++= Seq( "com.typesafe.slick", "org.scaloid", "org.macroid", "com.google", "io.spray" )

Trying to give SBT/Java/something more memory:

val buildSettings = Defaults.defaultSettings ++ Seq( javaOptions += "-Xmx8G" )

Switching to newer Proguard in projects/proguard.sbt (tried both 5.1 and 5.2.1):

libraryDependencies += "net.sf.proguard" % "proguard-base" % "5.2.1"

I'm watching the Task Manager and the java process never exceeds 700 MB (and there's plenty to spare). I'm at SBT version 0.13.9 and Scala version 2.11.7.

Output log starting from when ProGuard kicks in:

ProGuard, version 5.2.1 ProGuard is released under the GNU General Public License. You therefore must ensure that programs that link to it (android, ...) carry the GNU General Public License as well. Alternatively, you can apply for an exception with the author of ProGuard. Reading input... Reading program jar C:\Users\Myself.ivy2\cache\org.scala-lang\scala-reflect\jars\scala-reflect-2.11.7.jar Reading program jar C:\projects\myapp\android\target\android\intermediates\aars\com.google.android.gms-play-services-4.4.52\com.google.android. gms-play-services-4.4.52.jar Reading program jar C:\Users\Myself.ivy2\cache\org.scala-lang\scala-compiler\jars\scala-compiler-2.11.0.jar Reading program jar C:\Users\Myself.ivy2\cache\org.slf4j\slf4j-api\jars\slf4j-api-1.7.12.jar Reading program jar C:\Users\Myself.ivy2\cache\com.typesafe.slick\slick_2.11\jars\slick_2.11-2.1.0.jar Reading program jar C:\Users\Myself.ivy2\cache\org.slf4j\slf4j-nop\jars\slf4j-nop-1.7.12.jar Reading program jar C:\Users\Myself.ivy2\cache\com.splunk.mint\mint\jars\mint-4.4.0.jar Reading program jar C:\Users\Myself.ivy2\cache\io.spray\spray-json_2.11\jars\spray-json_2.11-1.3.2.jar Reading program jar C:\Users\Myself.ivy2\cache\com.squareup.okio\okio\jars\okio-1.6.0.jar Reading program jar C:\projects\myapp\android\target\android\intermediates\aars\com.android.support-support-v4-22.1.1\com.android.support-suppo rt-v4-22.1.1.jar Reading program jar C:\Users\Myself.ivy2\cache\org.scala-lang.modules\scala-async_2.11\bundles\scala-async_2.11-0.9.2.jar Reading program jar C:\Users\Myself.ivy2\cache\org.brianmckenna\wartremover_2.11\jars\wartremover_2.11-0.10.jar Reading program jar C:\Users\Myself.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.11.7.jar Reading program jar C:\Users\Myself.ivy2\cache\com.github.nscala-time\nscala-time_2.11\jars\nscala-time_2.11-2.2.0.jar Reading program jar C:\Users\Myself.ivy2\cache\org.joda\joda-convert\jars\joda-convert-1.2.jar Reading program jar C:\Users\Myself.ivy2\cache\com.typesafe\config\bundles\config-1.2.1.jar Reading program jar C:\Users\Myself.ivy2\cache\com.squareup.okhttp\okhttp\jars\okhttp-2.5.0.jar Reading program jar C:\Users\Myself.ivy2\cache\org.sqldroid\sqldroid\jars\sqldroid-1.0.3.jar Reading program jar C:\dev\android\extras\android\m2repository\com\android\support\support-annotations\22.1.1\support-annotations-22.1.1.jar Reading program jar C:\projects\myapp\android\target\android\intermediates\aars\org.macroid-macroid_2.11-2.0.0-M4\org.macroid-macroid_2.11-2.0. 0-M4.jar Reading program jar C:\Users\Myself.ivy2\cache\org.scaloid\scaloid_2.11\jars\scaloid_2.11-4.0.jar Reading program jar C:\projects\myapp\android\target\android\intermediates\aars\com.android.support-support-v4-22.1.1\libs\internal_impl-22.1.1 .jar Reading program jar C:\Users\Myself.ivy2\cache\org.scala-lang.modules\scala-xml_2.11\bundles\scala-xml_2.11-1.0.1.jar Reading program jar C:\Users\Myself.ivy2\cache\org.scala-lang.modules\scala-parser-combinators_2.11\bundles\scala-parser-combinators_2.11-1.0.1.jar Reading program jar C:\Users\Myself.ivy2\cache\joda-time\joda-time\jars\joda-time-2.8.2.jar Reading program jar C:\projects\myapp\android\target\android\intermediates\classes.jar Reading library jar [C:\dev\android\platforms\android-23\android.jar] Reading library jar [C:\dev\android\platforms\android-23\optional\org.apache.http.legacy.jar] Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver] Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory] Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException] Note: duplicate definition of library class [org.apache.http.params.HttpParams] Note: duplicate definition of library class [android.net.http.SslCertificate$DName] Note: duplicate definition of library class [android.net.http.SslError] Note: duplicate definition of library class [android.net.http.SslCertificate] Note: there were 7 duplicate class definitions. (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass) Initializing... Note: the configuration refers to the unknown class 'Object' Maybe you meant the fully qualified name 'scala.tools.nsc.doc.model.Object'? Maybe you meant the fully qualified name 'java.lang.Object'? Note: scala.tools.nsc.typechecker.TypeStrings$class calls 'Class.getEnclosingClass' Warning: com.google.android.gms.common.GooglePlayServicesUtil: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang .CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Warning: okio.Okio: can't find referenced class java.nio.file.Files Warning: okio.Okio: can't find referenced class java.nio.file.Files Warning: okio.Okio: can't find referenced class java.nio.file.Files Warning: okio.Okio: can't find referenced class java.nio.file.Path Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption Warning: okio.Okio: can't find referenced class java.nio.file.Path Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Warning: okio.Okio: can't find referenced class java.nio.file.Path Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption Warning: okio.Okio: can't find referenced class java.nio.file.Path Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Warning: org.scaloid.common.TraitWebView$class: can't find referenced method 'int getVisibleTitleHeight()' in library class android.webkit.WebView java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:188) at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala:188) at sbt.Execute.next$1(Execute.scala:83) at sbt.Execute.processAll(Execute.scala:86) at sbt.Execute.runKeep(Execute.scala:66) at sbt.EvaluateTask$.liftedTree1$1(EvaluateTask.scala:359) at sbt.EvaluateTask$.run$1(EvaluateTask.scala:358) at sbt.EvaluateTask$.runTask(EvaluateTask.scala:378) at sbt.Aggregation$$anonfun$3.apply(Aggregation.scala:64) at sbt.Aggregation$$anonfun$3.apply(Aggregation.scala:62) at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:314) at sbt.Aggregation$.timedRun(Aggregation.scala:62) at sbt.Aggregation$.runTasks(Aggregation.scala:71) at sbt.Aggregation$$anonfun$applyDynamicTasks$1.apply(Aggregation.scala:112) at sbt.Aggregation$$anonfun$applyDynamicTasks$1.apply(Aggregation.scala:110) at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61) at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61) at sbt.Act$$anonfun$sbt$Act$$actParser0$1$$anonfun$sbt$Act$$anonfun$$evaluate$1$1$$anonfun$apply$10.apply(Act.scala:244) at sbt.Act$$anonfun$sbt$Act$$actParser0$1$$anonfun$sbt$Act$$anonfun$$evaluate$1$1$$anonfun$apply$10.apply(Act.scala:241) at sbt.Command$.process(Command.scala:93) at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98) at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98) at sbt.State$$anon$1.process(State.scala:184) at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98) at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.MainLoop$.next(MainLoop.scala:98) at sbt.MainLoop$.run(MainLoop.scala:91) at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70) at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65) at sbt.Using.apply(Using.scala:24) at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65) at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48) at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32) at sbt.MainLoop$.runLogged(MainLoop.scala:24) at sbt.StandardMain$.runManaged(Main.scala:53) at sbt.xMain.run(Main.scala:28) at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109) at xsbt.boot.Launch$.withContextLoader(Launch.scala:128) at xsbt.boot.Launch$.run(Launch.scala:109) at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35) at xsbt.boot.Launch$.launch(Launch.scala:117) at xsbt.boot.Launch$.apply(Launch.scala:18) at xsbt.boot.Boot$.runImpl(Boot.scala:41) at xsbt.boot.Boot$.main(Boot.scala:17) at xsbt.boot.Boot.main(Boot.scala) Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded at proguard.classfile.constant.Utf8Constant.getStringRepresentation(Utf8Constant.java:251) at proguard.classfile.constant.Utf8Constant.switchToStringRepresentation(Utf8Constant.java:174) at proguard.classfile.constant.Utf8Constant.getString(Utf8Constant.java:128) at proguard.classfile.ProgramClass.getString(ProgramClass.java:116) at proguard.classfile.ProgramMember.getName(ProgramMember.java:115) at proguard.classfile.ProgramClass.findMethod(ProgramClass.java:345) at proguard.classfile.ProgramClass.methodAccept(ProgramClass.java:523) at proguard.classfile.visitor.NamedMethodVisitor.visitProgramClass(NamedMethodVisitor.java:53) at proguard.classfile.ProgramClass.accept(ProgramClass.java:358) at proguard.classfile.ProgramClass.hierarchyAccept(ProgramClass.java:371) at proguard.classfile.util.MemberFinder.findMember(MemberFinder.java:86) at proguard.classfile.util.ClassReferenceInitializer.visitAnyRefConstant(ClassReferenceInitializer.java:212) at proguard.classfile.util.SimplifiedVisitor.visitAnyMethodrefConstant(SimplifiedVisitor.java:193) at proguard.classfile.util.SimplifiedVisitor.visitMethodrefConstant(SimplifiedVisitor.java:205) at proguard.classfile.constant.MethodrefConstant.accept(MethodrefConstant.java:69) at proguard.classfile.ProgramClass.constantPoolEntriesAccept(ProgramClass.java:457) at proguard.classfile.util.ClassReferenceInitializer.visitProgramClass(ClassReferenceInitializer.java:100) at proguard.classfile.ProgramClass.accept(ProgramClass.java:358) at proguard.classfile.ClassPool.classesAccept(ClassPool.java:124) at proguard.Initializer.execute(Initializer.java:146) at proguard.ProGuard.initialize(ProGuard.java:233) at proguard.ProGuard.execute(ProGuard.java:98) at android.Proguard$.proguard(proguard.scala:169) at android.Tasks$$anonfun$72.apply(tasks.scala:1031) at android.Tasks$$anonfun$72.apply(tasks.scala:1029) at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:35) at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:34) at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) [error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded [error] Use 'last' for the full log.

build.sbt looks like this:

import android.Keys. import android.Dependencies.aar import sbt.Keys. import android.PromptPasswordsSigningConfig

android.Plugin.androidBuild

val buildSettings = Defaults.defaultSettings ++ Seq( javaOptions += "-Xmx8G" )

platformTarget in Android := "android-23"

name := myapp-forms"

scalaVersion := "2.11.7"

run <<= run in Android

install <<= install in Android

resolvers ++= Seq( Resolver.sonatypeRepo("releases"), "jcenter" at "http://jcenter.bintray.com", "jbrechtel snapshots" at "http://jbrechtel.github.com/repo/snapshots", "scala tools snapshots" at "http://scala-tools.org/repo-snapshots", "scala tools releases" at "http://scala-tools.org/repo-releases", "bintray/non" at "http://dl.bintray.com/non/maven", "splunk" at "https://mint.splunk.com/gradle/" )

resolvers ++= Seq("snapshots", "releases").map(Resolver.sonatypeRepo)

dexMaxHeap in Android := "8192m"

scalacOptions += "-feature"

scalacOptions ++= Seq("-unchecked", "-deprecation") // for Robospecs

scalacOptions in Test ++= Seq("-Yrangepos") // for Specs2

libraryDependencies ++= Seq( aar("org.macroid" %% "macroid" % "2.0.0-M4"), "com.google.android.gms" % "play-services" % "4.4.52", "com.android.support" % "support-v4" % "22.1.1", "com.typesafe.slick" %% "slick" % "2.1.0" withSources() withJavadoc(), "org.slf4j" % "slf4j-nop" % "1.7.12" withSources() withJavadoc(), "com.github.nscala-time" %% "nscala-time" % "2.2.0" withSources() withJavadoc(), "io.spray" %% "spray-json" % "1.3.2" withSources() withJavadoc(), "com.squareup.okhttp" % "okhttp" % "2.5.0" withSources() withJavadoc(), "org.scaloid" %% "scaloid" % "4.0" withSources() withJavadoc(), "org.sqldroid" % "sqldroid" % "1.0.3" withSources() withJavadoc(), "com.splunk.mint" % "mint" % "4.4.0" withSources() withJavadoc(), "org.scalatest" % "scalatest_2.11" % "2.2.5" % "test" withSources() withJavadoc() )

proguardScala in Android := true

proguardOptions in Android ++= Seq( "-dontobfuscate", "-dontoptimize", "-ignorewarnings", "-keepattributes Signature", "-dontwarn scala.collection.", // required from Scala 2.11.3 "-dontwarn scala.collection.mutable.", // required from Scala 2.11.0 "-dontwarn javax.naming.InitialContext", "-dontnote org.slf4j.", "-keep class scala.Dynamic", "-keep class myapp.", "-keep class scala.collection.Seq.", "-keep public class org.sqldroid.", "-keep class scala.concurrent.Future$.", "-keep class scala.slick.lifted.", "-keep class scala.slick.jdbc.meta.", "-keep class scala.slick.driver.JdbcProfile$Implicits", "-keep class org.scaloid.", "-keep class org.scaloid.common.Logger", "-keep class scala.concurrent.Future", "-keep class macroid.", "-keep class com.squareup.okhttp.", "-keep class com.splunk.* { ; }" )

proguardCache in Android ++= Seq( "com.typesafe.slick", "org.scaloid", "org.macroid", "com.google", "io.spray" )

net.virtualvoid.sbt.graph.Plugin.graphSettings

packagingOptions in Android := PackagingOptions(excludes = Seq( "META-INF/LICENSE", "META-INF/LICENSE.txt", "META-INF/NOTICE", "META-INF/NOTICE.txt" ))

parallelExecution in Test := false

Any ideas? How can I force it to use the memory?

— Reply to this email directly or view it on GitHub https://github.com/pfn/android-sdk-plugin/issues/218.

tealsoftware commented 9 years ago

Thanks, that helped.