2012-08-05 76 views
0

我想運行一個與我的eclipse下載,尤其是NFC示例應用程序一起提供的示例應用程序。所以我加載它並運行它,但它會一直崩潰,出現以下錯誤。Android NFC示例 - java.lang.ExceptionInInitializerError

這裏是代碼本身 http://source-android.frandroid.com/development/samples/NFCDemo/src/com/example/android/nfc/

08-04 23:49:40.056: D/dalvikvm(409): VFY: replacing opcode 0x71 at 0x0003 
08-04 23:49:40.056: D/dalvikvm(409): VFY: dead code 0x0006-000b in Lcom/example/android/nfc/record/UriRecord;.<init> (Landroid/net/Uri;)V 
08-04 23:49:40.066: I/dalvikvm(409): Could not find method com.google.common.base.Preconditions.checkArgument, referenced from method com.example.android.nfc.record.UriRecord.parseWellKnown 
08-04 23:49:40.066: W/dalvikvm(409): VFY: unable to resolve static method 101: Lcom/google/common/base/Preconditions;.checkArgument (Z)V 
08-04 23:49:40.066: D/dalvikvm(409): VFY: replacing opcode 0x71 at 0x000c 
08-04 23:49:40.066: D/dalvikvm(409): VFY: dead code 0x000f-004f in Lcom/example/android/nfc/record/UriRecord;.parseWellKnown (Landroid/nfc/NdefRecord;)Lcom/example/android/nfc/record/UriRecord; 
08-04 23:49:40.066: W/dalvikvm(409): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/example/android/nfc/record/UriRecord; 
08-04 23:49:40.066: D/AndroidRuntime(409): Shutting down VM 
08-04 23:49:40.076: W/dalvikvm(409): threadid=1: thread exiting with uncaught exception (group=0x40015560) 
08-04 23:49:40.086: E/AndroidRuntime(409): FATAL EXCEPTION: main 
08-04 23:49:40.086: E/AndroidRuntime(409): java.lang.ExceptionInInitializerError 
08-04 23:49:40.086: E/AndroidRuntime(409): at com.example.android.nfc.NdefMessageParser.getRecords(NdefMessageParser.java:47) 
08-04 23:49:40.086: E/AndroidRuntime(409): at com.example.android.nfc.NdefMessageParser.parse(NdefMessageParser.java:41) 
08-04 23:49:40.086: E/AndroidRuntime(409): at com.example.android.nfc.TagViewer.buildTagViews(TagViewer.java:105) 
08-04 23:49:40.086: E/AndroidRuntime(409): at com.example.android.nfc.TagViewer.resolveIntent(TagViewer.java:86) 
08-04 23:49:40.086: E/AndroidRuntime(409): at com.example.android.nfc.TagViewer.onCreate(TagViewer.java:59) 
08-04 23:49:40.086: E/AndroidRuntime(409): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
08-04 23:49:40.086: E/AndroidRuntime(409): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 
08-04 23:49:40.086: E/AndroidRuntime(409): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 
08-04 23:49:40.086: E/AndroidRuntime(409): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 
08-04 23:49:40.086: E/AndroidRuntime(409): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 
08-04 23:49:40.086: E/AndroidRuntime(409): at android.os.Handler.dispatchMessage(Handler.java:99) 
08-04 23:49:40.086: E/AndroidRuntime(409): at android.os.Looper.loop(Looper.java:123) 
08-04 23:49:40.086: E/AndroidRuntime(409): at android.app.ActivityThread.main(ActivityThread.java:3683) 
08-04 23:49:40.086: E/AndroidRuntime(409): at java.lang.reflect.Method.invokeNative(Native Method) 
08-04 23:49:40.086: E/AndroidRuntime(409): at java.lang.reflect.Method.invoke(Method.java:507) 
08-04 23:49:40.086: E/AndroidRuntime(409): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
08-04 23:49:40.086: E/AndroidRuntime(409): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
08-04 23:49:40.086: E/AndroidRuntime(409): at dalvik.system.NativeStart.main(Native Method) 
08-04 23:49:40.086: E/AndroidRuntime(409): Caused by: java.lang.NoClassDefFoundError: com.google.common.collect.ImmutableBiMap 
08-04 23:49:40.086: E/AndroidRuntime(409): at com.example.android.nfc.record.UriRecord.<clinit>(UriRecord.java:51) 
08-04 23:49:40.086: E/AndroidRuntime(409): ... 18 more 

我是新來的Java,甚至較新的Android和不知道如何調試Android應用程序的鏈接。我試着在代碼中添加斷點,但沒有解僱。所以我希望能從這裏獲得幫助。

回答