报错:Link of class 'Lcom/.../PersistentConnectionListener;' failed ...VFY: unable to resolve new-insta

时间:2022-09-04 10:19:12

在使用xmpp推送的时候报如下错:

06-05 14:12:10.710: W/dalvikvm(8735): Link of class 'Lcom/.../PersistentConnectionListener;' failed

06-05 14:12:10.710: E/dalvikvm(8735): Could not find class 'com.....PersistentConnectionListener', referenced from method com.....XmppManager.<init>
06-05 14:12:10.710: W/dalvikvm(8735): VFY: unable to resolve new-instance 280 (Lcom/.../PersistentConnectionListener;) in Lcom/.../XmppManager;
06-05 14:12:10.710: W/dalvikvm(8735): VFY: unable to find class referenced in signature (Lorg/jivesoftware/smack/XMPPConnection;)
06-05 14:12:10.710: W/dalvikvm(8735): VFY: unable to resolve virtual method 1600: Lorg/jivesoftware/smack/XMPPConnection;.isConnected ()Z
06-05 14:12:10.710: W/dalvikvm(8735): VFY: unable to resolve virtual method 1600: Lorg/jivesoftware/smack/XMPPConnection;.isConnected ()Z
06-05 14:12:10.720: W/dalvikvm(8735): VFY: unable to find class referenced in signature (Lorg/jivesoftware/smack/XMPPConnection;)
06-05 14:12:10.720: W/dalvikvm(8735): VFY: unable to find class referenced in signature (Lorg/jivesoftware/smack/ConnectionListener;)
06-05 14:12:10.720: W/dalvikvm(8735): VFY: unable to find class referenced in signature (Lorg/jivesoftware/smack/PacketListener;)
06-05 14:12:10.720: W/dalvikvm(8735): VFY: unable to find class referenced in signature (Lorg/jivesoftware/smack/XMPPConnection;)
06-05 14:12:10.720: W/dalvikvm(8735): Link of class 'Lcom/.../PersistentConnectionListener;' failed
06-05 14:12:10.720: W/dalvikvm(8735): Link of class 'Lcom/.../NotificationPacketListener;' failed
06-05 14:12:10.720: W/dalvikvm(8735): threadid=1: thread exiting with uncaught exception (group=0x410bb9d8)
06-05 14:12:10.730: E/AndroidRuntime(8735): FATAL EXCEPTION: main
06-05 14:12:10.730: E/AndroidRuntime(8735): java.lang.NoClassDefFoundError: com.....PersistentConnectionListener
06-05 14:12:10.730: E/AndroidRuntime(8735): at com.....XmppManager.<init>(XmppManager.java:105)
06-05 14:12:10.730: E/AndroidRuntime(8735): at com.....NotificationService.onCreate(NotificationService.java:122)
06-05 14:12:10.730: E/AndroidRuntime(8735): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2266)
06-05 14:12:10.730: E/AndroidRuntime(8735): at android.app.ActivityThread.access$1600(ActivityThread.java:126)
06-05 14:12:10.730: E/AndroidRuntime(8735): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1204)
06-05 14:12:10.730: E/AndroidRuntime(8735): at android.os.Handler.dispatchMessage(Handler.java:99)
06-05 14:12:10.730: E/AndroidRuntime(8735): at android.os.Looper.loop(Looper.java:137)
06-05 14:12:10.730: E/AndroidRuntime(8735): at android.app.ActivityThread.main(ActivityThread.java:4439)
06-05 14:12:10.730: E/AndroidRuntime(8735): at java.lang.reflect.Method.invokeNative(Native Method)
06-05 14:12:10.730: E/AndroidRuntime(8735): at java.lang.reflect.Method.invoke(Method.java:511)
06-05 14:12:10.730: E/AndroidRuntime(8735): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
06-05 14:12:10.730: E/AndroidRuntime(8735): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)

06-05 14:12:10.730: E/AndroidRuntime(8735): at dalvik.system.NativeStart.main(Native Method)


解决方法:

检查需要的包是否已经导入,

如果包都已经导入的话,就对项目的libs之类的文件夹,也就是放要导入的jar包的文件夹右键->build path->use as source folder

这样应该就可以解决问题了,再运行一遍试试吧~


可以关注我的公众号~

报错:Link of class 'Lcom/.../PersistentConnectionListener;' failed ...VFY: unable to resolve new-insta