[英]NoClassDefFoundError in Eclipse
So essentially I've been making a game using libgdx and just recently I started to try and add Google Play Game Services and So I tried my hand at it and it seems as though I have completely messed up my .xml
file I've tried looking at questions such as How do I resolve this Java Class not found exception? 所以基本上我一直在使用libgdx制作游戏,最近我开始尝试添加Google Play游戏服务,所以我尝试了它,看起来我已经完全弄乱了我的
.xml
文件我试过了查看诸如如何解决此Java类未找到异常等问题? and NoClassDefFoundError - Eclipse and Android , but to no avail. 和NoClassDefFoundError - Eclipse和Android ,但无济于事。
Here is the runtime error I am recieving. 这是我收到的运行时错误。
02-19 19:25:17.772: E/AndroidRuntime(25746): FATAL EXCEPTION: main
02-19 19:25:17.772: E/AndroidRuntime(25746): Process: com.coppercow.minerman, PID: 25746
02-19 19:25:17.772: E/AndroidRuntime(25746): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.coppercow.minerman/com.coppercow.minerman.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.coppercow.minerman.MainActivity" on path: DexPathList[[zip file "/data/app/com.coppercow.minerman-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.coppercow.minerman-2, /vendor/lib, /system/lib]]
The class Name is MainActivity.Java and it is in the src file. 类名是MainActivity.Java,它位于src文件中。 I understand that this is done because of one of two things: My
.class
file, or the .xml
file. 我知道这是因为以下两件事之一:我的
.class
文件或.xml
文件。 So here is also my .xml
file just in case what I have done wrong is there and not in fact in any .class
file. 所以这里也是我的
.xml
文件,以防万一我做错了,实际上并没有在任何.class
文件中。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.coppercow.minerman"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
However I've messed around with this xml file quite a lot and so I do not believe it is in here and that My whole problem has to be in some .class
file somewhere, but I don't even understand how to access those from eclipse from going off of other questions asked here on StackOverflow. 但是我已经把这个xml文件搞砸了很多,所以我不相信它在这里,我的整个问题必须在某个
.class
文件中,但我甚至不知道如何从关于在StackOverflow上提出的其他问题。
Try this: 试试这个:
Go to Project/Properties/Java Build Path/Order and Export -- Make sure there's a check in front of Android Dependencies and the support library, if you use it.Mark all checkboxes and Click on Apply and clean the project. 转到项目/属性/ Java构建路径/订单和导出 - 确保在Android Dependencies和支持库前面有一个检查,如果您使用它。标记所有复选框并单击应用并清理项目。
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.