Android应用程序已停止使用NoClassDefFoundError

时间:2012-05-16 23:51:29

标签: java android

My Manifest file is below




<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="FXPAL.Unity.Android"
android:versionCode="1"
android:versionName="1.0" >

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

<application
    android:icon="@drawable/ic_launcher"
    android:theme="@android:style/Theme.Light" android:name=".UnityMobileApp" android:debuggable="true"
    android:label="@string/app_name" >
    <activity
        android:name=".UnityMain"
        android:label="@string/app_name" 
        android:theme="@android:style/Theme.Light.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="FXPAL.Unity.Android.LAUNCH" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity android:name=".IndividualViewActivity"
        android:label="@string/app_name" android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".EditPreferences" android:label="@string/app_name">
    </activity>
    <activity android:name=".LoginActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".SendPingActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".ReceivePingActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".SendNudgeActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".PlacesActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".IncomingCallActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".ReceiveNudgeActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".ConfirmNudgeActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".FinalNudgeActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <activity android:name=".ReportingActivity" android:label="@string/app_name"
        android:theme="@style/PageStyle">
    </activity>
    <service android:name=".ReportingService" />
    <receiver android:name=".StartupReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <category android:name="android.intent.category.HOME" />
        </intent-filter>
    </receiver>
    <receiver android:name=".PingNudgeReceiver">
        <intent-filter>
            <action android:name="com.xtify.android.sdk.SHOW_NOTIFICATION" />
            <!-- KEEP THE FORWARD SLASH IN FRONT OF THE API KEY ON THE LINE BELOW -->
            <data android:scheme="notif" android:host="notification.xtify.com"
                android:pathPrefix="/8d55490a-43ec-42d3-90f8-57c91ab06ce8" />
        </intent-filter>
    </receiver>
    <activity android:name="com.xtify.android.sdk.SettingsActivity"
        android:label="Settings">
    </activity>
    <activity android:name="com.xtify.android.sdk.NotificationDetailsActivity"
        android:label="Notification Details">
    </activity>
    <activity android:name="com.xtify.android.sdk.NotificationSettingsActivity"
        android:label="Notification Settings">
    </activity>
    <service android:name="com.xtify.android.sdk.MainService"
        android:label="Notifications Service">
        <intent-filter>
            <action android:name="com.xtify.android.sdk.IMainService" />
            <category android:name="com.xtify.android.sdk.IMainService" />
            <category android:name="com.xtify.android.sdk.IMainService.V1033"/>

        </intent-filter>
    </service>
    <receiver android:name="com.xtify.android.sdk.MainReceiver">
        <intent-filter>
            <!-- <action android:name="com.xtify.android.sdk.SHOW_NOTIFICATION" /> -->
            <action android:name="com.xtify.android.sdk.NOTIFICATION_CLICKED" />
            <action android:name="com.xtify.android.sdk.NOTIFICATION_CLEARED" />
            <!-- MAKE SURE THE API KEY ON THE NEXT LINE IS PRECEDED BY A SLASH -->
            <data android:scheme="notif" android:host="notification.xtify.com"
                android:pathPrefix="/8d55490a-43ec-42d3-90f8-57c91ab06ce8" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
            <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
            <action android:name="com.xtify.android.sdk.SEND_SETTINGS" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.PACKAGE_ADDED" />
            <action android:name="android.intent.action.PACKAGE_REMOVED" />
            <data android:scheme="package" />
        </intent-filter>
    </receiver>
    <meta-data android:name="XTIFY_SDK_API_KEY"
        android:value="8d55490a-43ec-42d3-90f8-57c91ab06ce8" />

</application>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>

   My LogCat File is

05-16 23:07:48.029: E/dalvikvm(768): Could not find class 'com.commonsware.cwac.merge.MergeAdapter', referenced from method FXPAL.Unity.Android.UnityMain.updateView
05-16 23:07:48.289: E/dalvikvm(768): Could not find class 'com.xtify.android.sdk.PersistentLocationManager', referenced from method         FXPAL.Unity.Android.ReportingService.onCreate
05-16 23:07:48.619: E/AndroidRuntime(768): FATAL EXCEPTION: main
05-16 23:07:48.619: E/AndroidRuntime(768): java.lang.NoClassDefFoundError: com.xtify.android.sdk.PersistentLocationManager
05-16 23:07:48.619: E/AndroidRuntime(768):  at FXPAL.Unity.Android.ReportingService.onCreate(ReportingService.java:240)
05-16 23:07:48.619: E/AndroidRuntime(768):  at android.app.ActivityThread.handleCreateService(ActivityThread.java:2253)
05-16 23:07:48.619: E/AndroidRuntime(768):  at android.app.ActivityThread.access$1600(ActivityThread.java:123)
05-16 23:07:48.619: E/AndroidRuntime(768):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
05-16 23:07:48.619: E/AndroidRuntime(768):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-16 23:07:48.619: E/AndroidRuntime(768):  at android.os.Looper.loop(Looper.java:137)
05-16 23:07:48.619: E/AndroidRuntime(768):  at android.app.ActivityThread.main(ActivityThread.java:4424)
05-16 23:07:48.619: E/AndroidRuntime(768):  at java.lang.reflect.Method.invokeNative(Native Method)
05-16 23:07:48.619: E/AndroidRuntime(768):  at java.lang.reflect.Method.invoke(Method.java:511)
05-16 23:07:48.619: E/AndroidRuntime(768):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-16 23:07:48.619: E/AndroidRuntime(768):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-16 23:07:48.619: E/AndroidRuntime(768):  at dalvik.system.NativeStart.main(Native Method)
05-16 23:22:50.419: E/dalvikvm(790): Could not find class 'com.xtify.android.sdk.PersistentLocationManager', referenced from method FXPAL.Unity.Android.ReportingService.onCreate
05-16 23:22:50.529: E/AndroidRuntime(790): FATAL EXCEPTION: main
05-16 23:22:50.529: E/AndroidRuntime(790): java.lang.NoClassDefFoundError: com.xtify.android.sdk.PersistentLocationManager
05-16 23:22:50.529: E/AndroidRuntime(790):  at FXPAL.Unity.Android.ReportingService.onCreate(ReportingService.java:240)
05-16 23:22:50.529: E/AndroidRuntime(790):  at android.app.ActivityThread.handleCreateService(ActivityThread.java:2253)
05-16 23:22:50.529: E/AndroidRuntime(790):  at android.app.ActivityThread.access$1600(ActivityThread.java:123)
05-16 23:22:50.529: E/AndroidRuntime(790):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
05-16 23:22:50.529: E/AndroidRuntime(790):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-16 23:22:50.529: E/AndroidRuntime(790):  at android.os.Looper.loop(Looper.java:137)
05-16 23:22:50.529: E/AndroidRuntime(790):  at android.app.ActivityThread.main(ActivityThread.java:4424)
05-16 23:22:50.529: E/AndroidRuntime(790):  at java.lang.reflect.Method.invokeNative(Native Method)
05-16 23:22:50.529: E/AndroidRuntime(790):  at java.lang.reflect.Method.invoke(Method.java:511)
05-16 23:22:50.529: E/AndroidRuntime(790):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-16 23:22:50.529: E/AndroidRuntime(790):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-16 23:22:50.529: E/AndroidRuntime(790):  at dalvik.system.NativeStart.main(Native Method)

我正在尝试将我的Android SDK从2.2升级到4.0.3。我发现了很多问题。我能够清除其中一些。但仍有少数人离开。你能否看看这些错误并帮助我修复它们。

我看了3天,但情况仍然如此。我没有得到任何编译错误,但在执行时我得到了logcat中显示的错误。它说没有找到课程。但我在很多不同的论坛上尝试过,但没有成功解决它们。

期待您的回复朋友。

此致 勒凯什

1 个答案:

答案 0 :(得分:5)

使用最新的SDK时,您需要确保所有外部库都位于名为libs的目录中。

将您的库移到libs目录中,然后再次清理/构建项目。