i was busy with my app for over a week, when suddenly:
11-12 07:59:17.860 1653-1653/nl.test.myapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.Runtim
In my case it was manifest declaration of android.app.Application
in project and actual code in module.
Looks like you have a namespace typo somewhere. Search for MyApp
and change it to myapp
.
I created a new project in Android studio and copied everything from the old project into the new one. Now it's working again, without any(!) modifications to the code.
I had the similar problem. I remembered, that previously "not enough memory" message was shown and the application uploading process could not finish, stopping on dexDebug with error. Then I released enough memory, but application started with ClassNotFoundException.
The solution that worked for me was to delete all "build" folders in the project. I suppose that gradle can put corrupted files to "build" folder when there is not enough memory.
GO to Build Menu and Clean Project.
The above solution worked perfectly fine for me.
When using Android Studio, please ensure that the "src" folder that contains your Java class is marked as "Source Root". Otherwise, it will not make it into the APK.