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 xml..
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mobile.batteryhelper/com.mobile.batteryhelper.Battery}:
java.lang.ClassNotFoundException: Caused by: java.lang.ClassNotFoundException: com.mobile.batteryhelper.Battery in loader dalvik.system.PathClassLoader[/mnt/asec/com.mobile.batteryhelper-1/pkg.apk]
Here is the androidmanifest.xml. Yes the .Battery class extends Activity also.
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Battery"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Have you tried to clean your workspace. Goto Project->Clean and select your project. For some reason eclipse doesn't build my manifest automatically.
You have put 3rd party library in library folder and reference them. Go to Properties/ Java Build Path/ Libraries/ Add External JARs.
Check the Jar files in the Properties/ Java Build Path/ Order and Export
Have you tried to initialise anything in your class before OnCreate gets called?
If you initialise static variables (for example) it can give you this (infuriatingly obtuse) error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With