3

我已经尝试了所有可能的解决方案来解决这个问题,但似乎没有任何效果......当我将我的 SDK 工具版本从 r16 更新到 r19 并将 SDK 平台工具版本更新到 r11 时,问题就出现了。我将所有类都包含在清单中,并且在此更新之前一切正常。你知道如何解决这个问题吗?(我从这个网站和其他网站尝试了很多解决方案......)

这是我的错误日志:

05-17 23:29:10.888: E/AndroidRuntime(20945): FATAL EXCEPTION: main
05-17 23:29:10.888: E/AndroidRuntime(20945): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.bugfullabs.depress/com.bugfullabs.depress.Splash}: java.lang.ClassNotFoundException: com.bugfullabs.depress.Splash
05-17 23:29:10.888: E/AndroidRuntime(20945):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at android.app.ActivityThread.access$600(ActivityThread.java:139)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at android.os.Looper.loop(Looper.java:154)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at android.app.ActivityThread.main(ActivityThread.java:4944)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at java.lang.reflect.Method.invokeNative(Native Method)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at java.lang.reflect.Method.invoke(Method.java:511)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at dalvik.system.NativeStart.main(Native Method)
05-17 23:29:10.888: E/AndroidRuntime(20945): Caused by: java.lang.ClassNotFoundException: com.bugfullabs.depress.Splash
05-17 23:29:10.888: E/AndroidRuntime(20945):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
05-17 23:29:10.888: E/AndroidRuntime(20945):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
05-17 23:29:10.888: E/AndroidRuntime(20945):    ... 11 more

这是我的 AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.bugfullabs.depress"
    android:versionCode="2"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".Splash"
            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=".DEpressActivity"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".SettingsMenu"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".Credits"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".game.LevelSelect"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".game.GameActivity"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".game.FinishScreen"
            android:label="@string/app_name" >
        </activity>
    </application>

</manifest>
4

1 回答 1

7

它找不到类:com.bugfullabs.depress.Splash.首先要确保包名中没有拼写错误。(似乎应该是bugfullaps)

接下来,Splash 类是否包含在库中?如果是这样,请检查您的 Java 构建路径配置,并确保在 Order and Export 选项卡下检查了您的库文件,以便将其与应用程序一起导出。

编辑:刚刚记住,如果您有一个lib目录,请将其重命名为libs.That's one of things that changed from the version you are using。祝你好运!

于 2012-05-17T22:33:21.850 回答