Android Smack 聊天客户端
嗨,朋友们,我正在使用从以下网址下载的 Smack3.2.1.jar
http://www.igniterealtime.org /downloads/index.jsp
我将 jar 添加到我的构建路径中但是当我运行应用程序时,我收到以下错误日志
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): FATAL EXCEPTION: main
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): java.lang.VerifyError: org.jivesoftware.smack.sasl.SASLMechanism
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.Class.getDeclaredConstructors(Native Method)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.Class.getConstructor(Class.java:477)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:314)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.jivesoftware.smack.Connection.login(Connection.java:348)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.apache.android.xmpp.SettingsDialog.onClick(SettingsDialog.java:54)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.view.View.performClick(View.java:2408)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.view.View$PerformClick.run(View.java:8816)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.os.Handler.handleCallback(Handler.java:587)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.os.Handler.dispatchMessage(Handler.java:92)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.os.Looper.loop(Looper.java:123)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.reflect.Method.invoke(Method.java:521)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at dalvik.system.NativeStart.main(Native Method)
任何人都可以帮忙...
Hi freinds I an using Smack3.2.1.jar downloaded from following url
http://www.igniterealtime.org/downloads/index.jsp
I added jar to my buildpath But when I run the application I get the following Error log
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): FATAL EXCEPTION: main
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): java.lang.VerifyError: org.jivesoftware.smack.sasl.SASLMechanism
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.Class.getDeclaredConstructors(Native Method)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.Class.getConstructor(Class.java:477)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:314)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.jivesoftware.smack.Connection.login(Connection.java:348)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.apache.android.xmpp.SettingsDialog.onClick(SettingsDialog.java:54)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.view.View.performClick(View.java:2408)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.view.View$PerformClick.run(View.java:8816)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.os.Handler.handleCallback(Handler.java:587)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.os.Handler.dispatchMessage(Handler.java:92)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.os.Looper.loop(Looper.java:123)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.reflect.Method.invoke(Method.java:521)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at dalvik.system.NativeStart.main(Native Method)
Can anyone help ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Smack 不适用于开箱即用的 Android,您可能需要使用 aSmack (http://code .google.com/p/asmack/),这是 Android 的 smack 端口。
Smack doesn't work on android out of the box, you may want to use aSmack (http://code.google.com/p/asmack/) which is a port of smack for Android.
最后我得到了具体的实现
任何想要开发聊天客户端的人都可以按照下面提到的步骤进行操作。
转到链接
http://www.beem-project.com/projects/beem/files< /a>
下载
asmack-android-7-source-beem.zip
现在根据您的要求修改此源。
您将找到lib asmack-android-7-beem.jar来获取该lib的javadoc,它与smack的javadoc相同,我所做的如下。
从下面的链接下载源 smack-3.2.1
http://www.igniterealtime.org/downloads/index .jsp
当您提取 jar 时,您将获得名为 javadoc 的文件夹,现在只需通过转到项目的属性将此文件夹附加到 asmack-android-7-beem.jar 即可。
嘻哈嘻哈万岁......
Finally I got the Concrete implementation
Anyone who want to develop chat client then follow the steps mentioned below.
Go to link
http://www.beem-project.com/projects/beem/files
Download
asmack-android-7-source-beem.zip
Now modify this source as per your requirement.
You will find the lib asmack-android-7-beem.jar to obtain javadoc for this lib its same as javadoc for smack what i did is as follows.
Download source smack-3.2.1 from link below
http://www.igniterealtime.org/downloads/index.jsp
When you extract the jar you will get the folder named javadoc now just attach this folder to asmack-android-7-beem.jar by going to the properties of your project.
Hip Hip Hurray....
您无法在 Android 上使用 Smack 4 之前的普通 Smack。查看“Android 和 XMPP:当前可用的解决方案”
You can't use vanilla Smack prior Smack 4 on Android. Have a look at "Android and XMPP: Currently available solutions"
使用依赖项将其注入到您的 build.gradle 中
use dependencies inject this in your build.gradle