ClassNotFoundException 与清单中声明的类
好吧,我刚刚开始收到这个错误。
01-03 15:31:51.610: E/AndroidRuntime(14203): at java.lang.reflect.Method.invoke(Method.java:491)
01-03 15:31:51.610: E/AndroidRuntime(14203): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
01-03 15:31:51.610: E/AndroidRuntime(14203): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
01-03 15:31:51.610: E/AndroidRuntime(14203): at dalvik.system.NativeStart.main(Native Method)
01-03 15:31:51.610: E/AndroidRuntime(14203): Caused by: java.lang.ClassNotFoundException: com.fttech.MenuActivity in loader dalvik.system.PathClassLoader[/data/app/com.fttech.app-1.apk]
01-03 15:31:51.610: E/AndroidRuntime(14203): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
01-03 15:31:51.610: E/AndroidRuntime(14203): at java.lang.ClassLoader.loadClass(ClassLoader.java:540)
01-03 15:31:51.610: E/AndroidRuntime(14203): at java.lang.ClassLoader.loadClass(ClassLoader.java:500)
01-03 15:31:51.610: E/AndroidRuntime(14203): at android.app.Instrumentation.newActivity(Instrumentation.java:1022)
01-03 15:31:51.610: E/AndroidRuntime(14203): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1663)
我已在清单中声明了它!
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
<activity android:name=".MenuActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
有人知道这来自什么吗?
编辑:
我还注意到它说..
01-03 15:31:51.610: E/AndroidRuntime(14203): Caused by: java.lang.ClassNotFoundException: com.fttech.MenuActivity in loader dalvik.system.PathClassLoader[/data/app/com.fttech.app-1.apk]
它应该是 app_1.apk 而不是 apk-1.apk
有人有这个问题吗?
Okay so i just started getting this error.
01-03 15:31:51.610: E/AndroidRuntime(14203): at java.lang.reflect.Method.invoke(Method.java:491)
01-03 15:31:51.610: E/AndroidRuntime(14203): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
01-03 15:31:51.610: E/AndroidRuntime(14203): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
01-03 15:31:51.610: E/AndroidRuntime(14203): at dalvik.system.NativeStart.main(Native Method)
01-03 15:31:51.610: E/AndroidRuntime(14203): Caused by: java.lang.ClassNotFoundException: com.fttech.MenuActivity in loader dalvik.system.PathClassLoader[/data/app/com.fttech.app-1.apk]
01-03 15:31:51.610: E/AndroidRuntime(14203): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
01-03 15:31:51.610: E/AndroidRuntime(14203): at java.lang.ClassLoader.loadClass(ClassLoader.java:540)
01-03 15:31:51.610: E/AndroidRuntime(14203): at java.lang.ClassLoader.loadClass(ClassLoader.java:500)
01-03 15:31:51.610: E/AndroidRuntime(14203): at android.app.Instrumentation.newActivity(Instrumentation.java:1022)
01-03 15:31:51.610: E/AndroidRuntime(14203): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1663)
I have it declared in my manifest!
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
<activity android:name=".MenuActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Anyone know what this comes from?
EDIT:
Also i noticed it saying..
01-03 15:31:51.610: E/AndroidRuntime(14203): Caused by: java.lang.ClassNotFoundException: com.fttech.MenuActivity in loader dalvik.system.PathClassLoader[/data/app/com.fttech.app-1.apk]
Where it should be app_1.apk not apk-1.apk
Anyone have this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将完整路径放入活动(包含包),清理项目并刷新工作区。
也许您更改了启动活动,或者更改了名称,并留下了一些垃圾。
Try putting the complete path to the Activity (With the package), clean the project and refresh the workspace.
Maybe you changed the launch activity or you changes the name and some garbage stayed.