jberkel / android-plugin

An sbt plugin for Android development in Scala
https://groups.google.com/forum/#!forum/scala-on-android
Other
476 stars 113 forks source link

Excess write #197

Closed danosipov closed 10 years ago

danosipov commented 11 years ago

I keep hitting this error at random - ie running "sbt clean start" repeatedly eventually resolves it:

[info] Dexing /Users/dano/Documents/android-actors/target/classes-androidactors-compile-0.1.dex

trouble writing output: excess write of 16
java.lang.RuntimeException: Nonzero exit value: 2
    at scala.sys.package$.error(package.scala:27)
    at scala.Predef$.error(Predef.scala:123)
    at sbt.AbstractProcessBuilder.getString(ProcessImpl.scala:144)
    at sbt.AbstractProcessBuilder.$bang$bang(ProcessImpl.scala:146)
    at sbtandroid.AndroidInstall$$anonfun$dxTask$1$$anonfun$dexing$1$3.apply(AndroidInstall.scala:90)
    at sbtandroid.AndroidInstall$$anonfun$dxTask$1$$anonfun$dexing$1$3.apply(AndroidInstall.scala:90)
    at sbt.MultiLogger.log(MultiLogger.scala:31)
    at sbt.Logger$class.debug(Logger.scala:112)
    at sbt.AbstractLogger.debug(Logger.scala:11)
    at sbtandroid.AndroidInstall$$anonfun$dxTask$1.dexing$1(AndroidInstall.scala:90)
    at sbtandroid.AndroidInstall$$anonfun$dxTask$1.apply(AndroidInstall.scala:111)
    at sbtandroid.AndroidInstall$$anonfun$dxTask$1.apply(AndroidInstall.scala:67)
    at sbt.Scoped$$anonfun$hf11$1.apply(Structure.scala:587)
    at sbt.Scoped$$anonfun$hf11$1.apply(Structure.scala:587)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)
    at sbt.std.Transform$$anon$5.work(System.scala:71)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:238)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:680)
[error] (compile:dx) Nonzero exit value: 2

The issue is outside the plugin, thrown by the Android dexer (https://android.googlesource.com/platform/dalvik2/+/master/dx/src/com/android/dx/dex/file/DexFile.java), but why would it be fed different input if nothing in the project has changed between runs?

aginiewicz commented 11 years ago

I've seen this with Build Tools version 19, currently downgraded and it behaves normally again. I wonder, if this is issue with Build Tools itself, or with how it is used by plugin?

aginiewicz commented 11 years ago

Any news on this? I've tried 0.7.1-SNAPSHOT, also with some updates like increased memory, updated proguard or ddmlib to latest versions, still random failures with BT 19. Any idea of how to debug it? Or maybe report it upstream?

edit:

downgrading only build tools to 18.1.1 from release 19, leaving platform tools on 19 and tools on 22.3 and platform on 19 works.

edit2:

can https://code.google.com/p/android/issues/detail?id=61710 be related? It's not "excess write of" but "BufferOverflowException", but still seems close, as in both cases it tries to write too many bytes

aginiewicz commented 10 years ago

Works with 19.0.1

danosipov commented 10 years ago

Appears to work for me too. Closing.