Android Studio: ClassNotFoundException

后端 未结 17 892
时光说笑
时光说笑 2021-01-11 13:23

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         


        
相关标签:
17条回答
  • 2021-01-11 14:00

    In my case it was manifest declaration of android.app.Application in project and actual code in module.

    0 讨论(0)
  • 2021-01-11 14:05

    Looks like you have a namespace typo somewhere. Search for MyApp and change it to myapp.

    0 讨论(0)
  • 2021-01-11 14:07

    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.

    0 讨论(0)
  • 2021-01-11 14:08

    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.

    0 讨论(0)
  • 2021-01-11 14:09

    GO to Build Menu and Clean Project.

    The above solution worked perfectly fine for me.

    0 讨论(0)
  • 2021-01-11 14:13

    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.

    0 讨论(0)
提交回复
热议问题