Android java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

前端 未结 12 1682
太阳男子
太阳男子 2021-01-12 03:49

Ok guys this doesn\'t make sense to me at all and I don\'t understand why I am getting this error in my app. I have registered the activity class in the android manifrest xm

12条回答
  •  失恋的感觉
    2021-01-12 04:28

    Either your manifest package is not com.mobile.batteryhelper, or there is no com.mobile.batteryhelper.Battery class in your code. Possibly you don't have a public constructor for the class or the class is not declared public (though I think you would get a slightly different error message in that case).

    Make sure that you aren't using ProGuard to strip your code. Make sure the class is public, in the correct package (same as your manifest package), and doesn't have a constructor. Also it would be useful to see the entire error stack crawl in case there is something useful inside of it.

提交回复
热议问题