android force close: ClassNotFoundException for Activity class

前端 未结 11 1339
情歌与酒
情歌与酒 2020-12-29 08:04

When I start my (soon-to-be) android game (from eclipse) it opens, but immediately force-closes.

Logcat says:

07-09 17:12:35.709: ERROR/AndroidRuntim         


        
相关标签:
11条回答
  • 2020-12-29 08:25

    Just had this same problem. Was going nuts. Fully restarted emulator/adb/and eclipse and it fixed it. Strange stuff...

    0 讨论(0)
  • 2020-12-29 08:29

    I know it's not your problem , but I had exactly the same problem. Suddenly my app stopped working. I didint make any change to manifest, but with some accident there was missing first row:

    <?xml version="1.0" encoding="utf-8"?>

    This caused ClassNotFoundException for launcher activity. I was struggling with that for few hours and I overlooked this every time I was checking manifest for possible mistake.

    Strange thing happened after I have deleted this row again. Suprise, suprise app was still working. (and I didnt forget to rebuild app)

    Hope this help someone to save few hours.

    0 讨论(0)
  • 2020-12-29 08:32

    Not really a solution but this fixed it:

    creating a new project from scratch and migrating the code

    Please close this if something like it is possible here.

    Thanks for all your ideas and thoughts!

    0 讨论(0)
  • 2020-12-29 08:33

    Did you rename in Eclipse. Double check that it renamed with sub-package correctly. In my case it removed the dot:

    Wrong: ui.MyActivity

    Fix: .ui.MyActivity

    0 讨论(0)
  • 2020-12-29 08:35

    I had the same problem and in my case, I had forgot to put a library in the Android Manifest. I had a MapView Activity and I had forgot to put :

    <uses-library android:name="com.google.android.maps"/>.
    

    So, you should make sure you have all your library included in your manifest.

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