我有一個使用android-support-v4.jar的應用程序。這個jar在eclipse中的構建路徑上。如果我右鍵單擊包並配置構建路徑,它作爲庫存在那裏。在源代碼中我可以用它和Eclipse知道它是什麼,但如果我運行應用程序,我得到這個運行時錯誤android-support-v4.jar在構建路徑上,但得到noClassDefFoundError
01-13 15:39:51.838: E/AndroidRuntime(12398): FATAL EXCEPTION: main
01-13 15:39:51.838: E/AndroidRuntime(12398): java.lang.NoClassDefFoundError: android.support.v4.content.LocalBroadcastManager
01-13 15:39:51.838: E/AndroidRuntime(12398): at com.carefreegroup.NfcscannerActivity.processTagWithGPS(NfcscannerActivity.java:1568)
01-13 15:39:51.838: E/AndroidRuntime(12398): at com.carefreegroup.NfcscannerActivity.onActivityResult(NfcscannerActivity.java:1742)
01-13 15:39:51.838: E/AndroidRuntime(12398): at android.app.Activity.dispatchActivityResult(Activity.java:4747)
01-13 15:39:51.838: E/AndroidRuntime(12398): at android.app.ActivityThread.deliverResults(ActivityThread.java:3394)
01-13 15:39:51.838: E/AndroidRuntime(12398): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3448)
01-13 15:39:51.838: E/AndroidRuntime(12398): at android.app.ActivityThread.access$1100(ActivityThread.java:139)
01-13 15:39:51.838: E/AndroidRuntime(12398): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
01-13 15:39:51.838: E/AndroidRuntime(12398): at android.os.Handler.dispatchMessage(Handler.java:99)
01-13 15:39:51.838: E/AndroidRuntime(12398): at android.os.Looper.loop(Looper.java:156)
01-13 15:39:51.838: E/AndroidRuntime(12398): at android.app.ActivityThread.main(ActivityThread.java:4987)
01-13 15:39:51.838: E/AndroidRuntime(12398): at java.lang.reflect.Method.invokeNative(Native Method)
01-13 15:39:51.838: E/AndroidRuntime(12398): at java.lang.reflect.Method.invoke(Method.java:511)
01-13 15:39:51.838: E/AndroidRuntime(12398): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-13 15:39:51.838: E/AndroidRuntime(12398): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-13 15:39:51.838: E/AndroidRuntime(12398): at dalvik.system.NativeStart.main(Native Method)
有任何人任何想法,爲什麼?提前致謝。
嘗試清理您的項目。或者將支持jar移動到'libs'文件夾中。 – Doomsknight