Eclipse中的NoClassDefFoundError [英] NoClassDefFoundError in Eclipse

查看:183
本文介绍了Eclipse中的NoClassDefFoundError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以本来我一直在使用libgdx做一个游戏,最近刚开始尝试添加Google Play游戏服务,所以我尝试了我的手,似乎完全搞砸了我的 .xml 文件我试过看过一些问题,如如何解决此Java Class找不到异常? NoClassDefFoundError - Eclipse和Android ,但无效。

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? and NoClassDefFoundError - Eclipse and Android, but to no avail.

以下是我收到的运行时错误。

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]]

类名是MainActivity.Java,它在src文件中。我明白这是因为以下两件事之一:我的 .class 文件或 .xml 文件。所以这里也是我的 .xml 文件,以防万一我做错了,而不是事实上在任何 .class 文件。

The class Name is MainActivity.Java and it is in the src file. I understand that this is done because of one of two things: My .class file, or the .xml file. 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 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>

然而,我已经搞砸了这个xml文件了很多,所以我不相信在这里,我的整个问题必须在一些 .class 文件的某个地方,但我甚至不了解如何从日食中获取其他问题这里是StackOverflow。

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.

推荐答案

尝试这样:

/属性/ Java构建路径/订单和导出 - 确保在Android依赖关系和支持库前面进行检查,如果您使用它。标记所有复选框,然后单击应用并清理项目。

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.

希望这有帮助。

这篇关于Eclipse中的NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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