java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

前端 未结 30 2454
感动是毒
感动是毒 2020-11-22 15:15

I was trying to run a sample code While launching the application in the android 1.5 emulator , I got these errors.... Any one have some hint..?

ERROR from LogCat:<

30条回答
  •  太阳男子
    2020-11-22 15:59

    For me, my package string in AndroidManifest.xml was incorrect (copied from a tutorial). Make sure the package string in this file is the same as where your main activity is, e.g.

     package="com.example.app"
    

    An easy way to do this is to open the AndroidManifest.xml file in the "Manifest" tab, and type it in the text box next to Package, or use the Browse button.

    Also, the package string for my activity was wrong, e.g.

    
    

    I (stupidly) got the same error weeks later when I renamed my package name. If you do this, make sure you update the AndroidManifest.xml file too.

提交回复
热议问题