新浪微博SDK引用时出现NoClassDefFoundError和VFY: unable to resolve static field 867....R$style错误

时间:2022-09-04 10:23:54

10-16 10:13:46.039: W/dalvikvm(717): VFY: unable to resolve static field 867 (ContentOverlay) in Lcom/weibo/android/R$style;

我将com_weibo_android.jar添加到libs文件下仍然出错:
10-16 10:13:46.039: W/dalvikvm(717): VFY: unable to resolve static field 867 (ContentOverlay) in Lcom/weibo/android/R$style;
10-16 10:13:46.039: D/dalvikvm(717): VFY: replacing opcode 0x60 at 0x0000
10-16 10:13:46.049: D/dalvikvm(717): VFY: dead code 0x0002-000b in Lcom/weibo/net/WeiboDialog;.<init> (Lcom/weibo/net/Weibo;Landroid/content/Context;Ljava/lang/String;Lcom/weibo/net/WeiboDialogListener;)V
10-16 10:13:46.059: W/dalvikvm(717): VFY: unable to resolve static field 848 (close_selector) in Lcom/weibo/android/R$drawable;
10-16 10:13:46.059: D/dalvikvm(717): VFY: replacing opcode 0x60 at 0x001e
10-16 10:13:46.069: D/dalvikvm(717): VFY: dead code 0x0020-005f in Lcom/weibo/net/WeiboDialog;.setUpCloseBtn ()V
10-16 10:13:46.079: W/dalvikvm(717): VFY: unable to resolve static field 845 (dialog_left_margin) in Lcom/weibo/android/R$dimen;
..........................
10-16 10:13:46.099: E/AndroidRuntime(717): FATAL EXCEPTION: main
10-16 10:13:46.099: E/AndroidRuntime(717): java.lang.NoClassDefFoundError: com.weibo.android.R$style
..................

这是因为你只是引用了jar包,但是没有引进资源,所以生成不了R类,在project.properties里面添加一行:
android.library.reference.1=../com_weibo_android
而且你要注意一点!!!  把你原来添加的在libs下的jar包删除掉,不然会有两个一样的jar包在你的工程。