I am using the new Android studio and Gradle to create a test project. I configured it by default (new project wizard). Everything seems to be working fine, except that I am specifying my own instance of the application in the manifest file. The application works fine, but then it crashes when launched on the device:
Caused by: java.lang.ClassNotFoundException: Didn't find class "co.touchlab.android.testapp.MyApplication" on path: /data/app/co.touchlab.android.testapp-1.apk at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65) at java.lang.ClassLoader.loadClass(ClassLoader.java:501) at java.lang.ClassLoader.loadClass(ClassLoader.java:461) at android.app.Instrumentation.newApplication(Instrumentation.java:968) at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
Intellij seems to think that everything is in order, and if I select this application, it will work (until I get to the screen that tries to use it, of course).
I'm probably going to copy this into my regular distribution and let it twist idea 12 until it is sorted, but obviously something needs to be figured out. Try the full stock application with the custom Application class and see if it has problems.
Kevin galligan
source share