NoClassDefFound尝试运行导入的项目时出错

时间:2015-07-29 07:45:57

标签: android logcat noclassdeffounderror

我正在将项目导入我的工作区并尝试运行它。没有错误,启动画面完美启动。但是,在启动主活动时,应用程序崩溃并出现NoClassDefFound错误。这是logcat

07-29 12:41:13.388: E/AndroidRuntime(31120): FATAL EXCEPTION: main
07-29 12:41:13.388: E/AndroidRuntime(31120): Process: com.dginc.laughrt, PID: 31120
07-29 12:41:13.388: E/AndroidRuntime(31120): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/dginc/laughrt/MainActivity;
07-29 12:41:13.388: E/AndroidRuntime(31120):    at com.dginc.laughrt.SplashActivity$1.run(SplashActivity.java:23)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at android.os.Handler.handleCallback(Handler.java:739)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at android.os.Handler.dispatchMessage(Handler.java:95)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at android.os.Looper.loop(Looper.java:135)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at android.app.ActivityThread.main(ActivityThread.java:5254)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at java.lang.reflect.Method.invoke(Native Method)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at java.lang.reflect.Method.invoke(Method.java:372)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
07-29 12:41:13.388: E/AndroidRuntime(31120): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.dginc.laughrt.MainActivity" on path: DexPathList[[zip file "/data/app/com.dginc.laughrt-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
07-29 12:41:13.388: E/AndroidRuntime(31120):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
07-29 12:41:13.388: E/AndroidRuntime(31120):    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
07-29 12:41:13.388: E/AndroidRuntime(31120):    ... 9 more
07-29 12:41:13.388: E/AndroidRuntime(31120):    Suppressed: java.lang.NoClassDefFoundError: com.dginc.laughrt.MainActivity
07-29 12:41:13.388: E/AndroidRuntime(31120):        at dalvik.system.DexFile.defineClassNative(Native Method)
07-29 12:41:13.388: E/AndroidRuntime(31120):        at dalvik.system.DexFile.defineClass(DexFile.java:226)
07-29 12:41:13.388: E/AndroidRuntime(31120):        at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
07-29 12:41:13.388: E/AndroidRuntime(31120):        at dalvik.system.DexPathList.findClass(DexPathList.java:321)
07-29 12:41:13.388: E/AndroidRuntime(31120):        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
07-29 12:41:13.388: E/AndroidRuntime(31120):        ... 11 more
07-29 12:41:13.388: E/AndroidRuntime(31120):    Suppressed: java.lang.ClassNotFoundException: com.dginc.laughrt.MainActivity
07-29 12:41:13.388: E/AndroidRuntime(31120):        at java.lang.Class.classForName(Native Method)
07-29 12:41:13.388: E/AndroidRuntime(31120):        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
07-29 12:41:13.388: E/AndroidRuntime(31120):        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
07-29 12:41:13.388: E/AndroidRuntime(31120):        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
07-29 12:41:13.388: E/AndroidRuntime(31120):        ... 10 more
07-29 12:41:13.388: E/AndroidRuntime(31120):    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

这是我项目的清单文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.dginc.laughrt"
    android:versionCode="3"
    android:versionName="2.0" >

    <uses-sdk
        android:minSdkVersion="15"
        android:targetSdkVersion="19" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" >
    </uses-permission>
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />

    <application
        android:allowBackup="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/justlaughicon1"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.dginc.laughrt.SplashActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.dginc.laughrt.MainActivity"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name="com.dginc.laughrt.Second"
            android:label="@string/app_name" >
        </activity>

        <service
            android:name="com.dginc.laughrt.MediaPlayerService"
            android:enabled="true" >
        </service>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
        <activity
            android:name="com.chartboost.sdk.CBImpressionActivity"
            android:excludeFromRecents="true"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <activity android:name="com.startapp.android.publish.list3d.List3DActivity"
          android:theme="@android:style/Theme" />

<activity android:name="com.startapp.android.publish.OverlayActivity"
          android:theme="@android:style/Theme.Translucent"
          android:configChanges="orientation|keyboardHidden|screenSize" />

<activity android:name="com.startapp.android.publish.FullScreenActivity"
          android:theme="@android:style/Theme"
          android:configChanges="orientation|keyboardHidden|screenSize" />
    </application>

</manifest>

请帮帮我。

0 个答案:

没有答案