Android Smack 聊天客户端

发布于 2024-12-09 12:51:28 字数 2369 浏览 1 评论 0原文

嗨,朋友们,我正在使用从以下网址下载的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

ら栖息 2024-12-16 12:51:28

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.

丑丑阿 2024-12-16 12:51:28

最后我得到了具体的实现

任何想要开发聊天客户端的人都可以按照下面提到的步骤进行操作。

转到链接

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....

脸赞 2024-12-16 12:51:28

无法在 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"

伊面 2024-12-16 12:51:28

使用依赖项将其注入到您的 build.gradle 中

 compile 'org.igniterealtime.smack:smack-android:4.1.6'
    compile 'org.igniterealtime.smack:smack-tcp:4.1.6'
    compile 'org.igniterealtime.smack:smack-im:4.1.6'
    compile 'org.igniterealtime.smack:smack-extensions:4.1.6'

use dependencies inject this in your build.gradle

 compile 'org.igniterealtime.smack:smack-android:4.1.6'
    compile 'org.igniterealtime.smack:smack-tcp:4.1.6'
    compile 'org.igniterealtime.smack:smack-im:4.1.6'
    compile 'org.igniterealtime.smack:smack-extensions:4.1.6'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文