jrudolph/scala-android-libs — Issue #4: Extending Application with Scala
Author: Macarse
Created: 2011-11-10 22:01:33+00:00
State: open

Issue related with:
http://groups.google.com/group/scala-on-android/browse_thread/thread/3bb7539ed5bdfaf4

Here's a sample code:
https://github.com/Macarse/ApplicationTest

Similar to the Actors issue. Using the sbt-android-plugin with proguard makes this code work, but using the scala libs in the device makes the app force close with the following stacktrace:

E/AndroidRuntime(20714): java.lang.RuntimeException: Unable to instantiate application com.test.MyApplication: java.lang.ClassNotFoundException: com.test.MyApplication in loader dalvik.system.PathClassLoader[/data/app/com.test-2.apk]
E/AndroidRuntime(20714):	at android.app.LoadedApk.makeApplication(LoadedApk.java:466)
E/AndroidRuntime(20714):	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3280)
E/AndroidRuntime(20714):	at android.app.ActivityThread.access$2200(ActivityThread.java:117)
E/AndroidRuntime(20714):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:969)
E/AndroidRuntime(20714):	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(20714):	at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(20714):	at android.app.ActivityThread.main(ActivityThread.java:3703)
E/AndroidRuntime(20714):	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(20714):	at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(20714):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
E/AndroidRuntime(20714):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/AndroidRuntime(20714):	at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(20714): Caused by: java.lang.ClassNotFoundException: com.test.MyApplication in loader dalvik.system.PathClassLoader[/data/app/com.test-2.apk]
E/AndroidRuntime(20714):	at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
E/AndroidRuntime(20714):	at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
E/AndroidRuntime(20714):	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime(20714):	at android.app.Instrumentation.newApplication(Instrumentation.java:942)
E/AndroidRuntime(20714):	at android.app.LoadedApk.makeApplication(LoadedApk.java:461)
E/AndroidRuntime(20714):	... 11 more
W/ActivityManager( 133): Force finishing activity com.test/.MainActivity
W/ActivityManager( 133): Force finishing activity com.whatsapp/.Conversati