安卓了java.lang.RuntimeException:无法实例化活动ComponentInfo [英] Android java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

查看:373
本文介绍了安卓了java.lang.RuntimeException:无法实例化活动ComponentInfo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

玉家伙这没有任何意义,我在所有我不明白为什么我收到这个错误在我的应用程序。我已经注册了活动课在android manifrest XML。

 了java.lang.RuntimeException:无法实例活动ComponentInfo {com.mobile.batteryhelper / com.mobile.batteryhelper.Battery}:
抛出java.lang.ClassNotFoundException:致:抛出java.lang.ClassNotFoundException:com.mobile.batteryhelper.Battery装载机dalvik.system.PathClassLoader [/mnt/asec/com.mobile.batteryhelper-1/pkg.apk]
 

下面是AndroidManifest.xml中。是的。电池类扩展活动也。

 <应用机器人:图标=@可绘制/图标机器人:标签=@字符串/ APP_NAME>
    <活动机器人:名称=电池
              机器人:标签=@字符串/ APP_NAME
               机器人:screenOrientation =画像>
        <意向滤光器>
            <作用机器人:名称=android.intent.action.MAIN/>
            <类机器人:名称=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>
    < /活性GT;
 

解决方案

您是否尝试过清理你的工作区。转到项目 - >清理并选择您的项目。出于某种原因,日食不会自动生成我的清单。

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.

这篇关于安卓了java.lang.RuntimeException:无法实例化活动ComponentInfo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆