Thanks for the response Jesper. What all did you do/remove from the Scala source code? I tried using the tips given by Lex Spoon in the note on the Scala site (http://www.scala-lang.org/node/160.) This basically involved tweaking ScalaObject and turning scala.reflect.ScalaBeanInfo into an empty class (per /src/android- library in the Scala source tree). I recompiled scala-library.jar and added that as an external JAR instead. I still get errors from the runtime:
06-07 17:31:05.596: ERROR/dalvikvm(689): LinearAlloc exceeded capacity, last=280 06-07 17:31:05.596: ERROR/dalvikvm(689): VM aborting 06-07 17:31:05.716: INFO/DEBUG(539): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 06-07 17:31:05.726: INFO/DEBUG(539): Build fingerprint: 'generic/sdk/ generic/:1.5/CUPCAKE/147336:eng/test-keys' 06-07 17:31:05.726: INFO/DEBUG(539): pid: 689, tid: 689 >>> /system/ bin/dexopt <<< 06-07 17:31:05.726: INFO/DEBUG(539): signal 11 (SIGSEGV), fault addr deadd00d 06-07 17:31:05.736: INFO/DEBUG(539): r0 00000328 r1 0000000c r2 0000000c r3 00000026 06-07 17:31:05.736: INFO/DEBUG(539): r4 deadd00d r5 004000d0 r6 ad083e10 r7 003fffac 06-07 17:31:05.756: INFO/DEBUG(539): r8 00000000 r9 00000000 10 00000000 fp 00000000 06-07 17:31:05.756: INFO/DEBUG(539): ip ad083eec sp bec118e8 lr afe13e4d pc ad03b5c2 cpsr 20000030 06-07 17:31:05.817: INFO/DEBUG(539): #00 pc 0003b5c2 / system/lib/libdvm.so 06-07 17:31:05.817: INFO/DEBUG(539): #01 pc 000424f2 / system/lib/libdvm.so 06-07 17:31:05.827: INFO/DEBUG(539): #02 pc 0005bb08 / system/lib/libdvm.so 06-07 17:31:05.837: INFO/DEBUG(539): #03 pc 0005bd90 / system/lib/libdvm.so 06-07 17:31:05.847: INFO/DEBUG(539): #04 pc 0005c600 / system/lib/libdvm.so 06-07 17:31:05.847: INFO/DEBUG(539): #05 pc 0005c830 / system/lib/libdvm.so 06-07 17:31:05.857: INFO/DEBUG(539): #06 pc 0004ec86 / system/lib/libdvm.so 06-07 17:31:05.857: INFO/DEBUG(539): #07 pc 0004ff5e / system/lib/libdvm.so 06-07 17:31:05.857: INFO/DEBUG(539): #08 pc 0005013a / system/lib/libdvm.so 06-07 17:31:05.867: INFO/DEBUG(539): #09 pc 00008a74 / system/bin/dexopt 06-07 17:31:05.867: INFO/DEBUG(539): #10 pc 00008bd2 / system/bin/dexopt 06-07 17:31:05.867: INFO/DEBUG(539): #11 pc 00008efc / system/bin/dexopt 06-07 17:31:05.877: INFO/DEBUG(539): #12 pc 0001fd1a / system/lib/libc.so 06-07 17:31:05.877: INFO/DEBUG(539): #13 pc 0000bcb2 / system/lib/libc.so 06-07 17:31:05.887: INFO/DEBUG(539): #14 pc b000157e / system/bin/linker 06-07 17:31:05.897: INFO/DEBUG(539): stack: 06-07 17:31:05.907: INFO/DEBUG(539): bec118a8 000000a4 06-07 17:31:05.907: INFO/DEBUG(539): bec118ac ad048977 /system/ lib/libdvm.so 06-07 17:31:05.917: INFO/DEBUG(539): bec118b0 afe39f90 06-07 17:31:05.917: INFO/DEBUG(539): bec118b4 afe39fe4 06-07 17:31:05.927: INFO/DEBUG(539): bec118b8 00000000 06-07 17:31:05.927: INFO/DEBUG(539): bec118bc afe13e4d /system/ lib/libc.so 06-07 17:31:05.927: INFO/DEBUG(539): bec118c0 00000328 06-07 17:31:05.937: INFO/DEBUG(539): bec118c4 afe12e69 /system/ lib/libc.so 06-07 17:31:05.937: INFO/DEBUG(539): bec118c8 000119e8 [heap] 06-07 17:31:05.937: INFO/DEBUG(539): bec118cc ad083e10 06-07 17:31:05.946: INFO/DEBUG(539): bec118d0 004000d0 06-07 17:31:05.946: INFO/DEBUG(539): bec118d4 ad083e10 06-07 17:31:05.946: INFO/DEBUG(539): bec118d8 003fffac 06-07 17:31:05.957: INFO/DEBUG(539): bec118dc afe12ecd /system/ lib/libc.so 06-07 17:31:05.957: INFO/DEBUG(539): bec118e0 df002777 06-07 17:31:05.957: INFO/DEBUG(539): bec118e4 e3a070ad 06-07 17:31:05.957: INFO/DEBUG(539): #00 bec118e8 000119e8 [heap] 06-07 17:31:05.957: INFO/DEBUG(539): bec118ec ad0424f7 /system/ lib/libdvm.so 06-07 17:31:05.957: INFO/DEBUG(539): #01 bec118f0 ad083e10 06-07 17:31:05.967: INFO/DEBUG(539): bec118f4 41533f70 06-07 17:31:05.967: INFO/DEBUG(539): bec118f8 00000118 06-07 17:31:05.967: INFO/DEBUG(539): bec118fc ad05b5bf /system/ lib/libdvm.so 06-07 17:31:05.967: INFO/DEBUG(539): bec11900 004000cc 06-07 17:31:05.967: INFO/DEBUG(539): bec11904 000119ec [heap] 06-07 17:31:05.977: INFO/DEBUG(539): bec11908 500009da 06-07 17:31:05.977: INFO/DEBUG(539): bec1190c 000088e9 /system/ bin/dexopt 06-07 17:31:05.977: INFO/DEBUG(539): bec11910 42707582 06-07 17:31:05.977: INFO/DEBUG(539): bec11914 00000005 06-07 17:31:05.977: INFO/DEBUG(539): bec11918 bec11990 [stack] 06-07 17:31:05.977: INFO/DEBUG(539): bec1191c ad05bb0d /system/ lib/libdvm.so 06-07 17:31:06.077: WARN/installd(543): DexInv: --- END '/data/app/ vmdl54064.tmp' --- status=0x000b, process failed 06-07 17:31:06.077: ERROR/installd(543): dexopt failed on '/data/ dalvik-cache/d...@app@vmdl54064....@classes.dex' res = 11 06-07 17:31:06.097: WARN/PackageManager(569): Package couldn't be installed in /data/app/hello.scala.apk 06-07 17:31:06.127: DEBUG/AndroidRuntime(630): Shutting down VM 06-07 17:31:06.127: DEBUG/dalvikvm(630): DestroyJavaVM waiting for non- daemon threads to exit 06-07 17:31:06.148: DEBUG/dalvikvm(630): DestroyJavaVM shutting VM down 06-07 17:31:06.148: DEBUG/dalvikvm(630): HeapWorker thread shutting down 06-07 17:31:06.157: DEBUG/dalvikvm(630): HeapWorker thread has shut down 06-07 17:31:06.157: DEBUG/jdwp(630): JDWP shutting down net... 06-07 17:31:06.187: DEBUG/dalvikvm(630): VM cleaning up 06-07 17:31:06.227: DEBUG/dalvikvm(630): LinearAlloc 0x0 used 627404 of 4194304 (14%) Maybe I need to trim down the jar, not just change those two classes? I tried this with just a simple hello world type of app. The app I am actually writing i a little more complex, and in particular I want to add some implicit conversions to allow closures to be used in place of ClickListeners, etc. Also, others have had success pruning the class files before sending them into dex using tools like Proguard: http://chneukirchen.org/blog/archive/2009/04/programming-for-android-with-scala.html. This makes the APK a lot smaller. -- Michael On May 25, 11:30 am, Jesper Nordenberg <megagu...@gmail.com> wrote: > I had the same problem you describe. After trimming down thescala- > library.jar file to only contain the core classes (about 1.8 MB) and > adding it as an external jar everything worked fine. However, Eclipse > build times are now quite long as the dex file is quite large and is > regenerated for each change, so we're looking for a way to add theScalajar as > a library in the emulator and adding it to the > application classpath. I don't know if this is possible and if it is, > the documentation is really hard to find. If you (or anyone else) can > share some hints on how to achieve this, I'd be grateful. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---