4

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

Flow
  • 23,572
  • 15
  • 99
  • 156
Ashwin N Bhanushali
  • 3,872
  • 5
  • 39
  • 59

4 Answers4

4

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.

Fredszaq
  • 3,091
  • 1
  • 18
  • 20
4

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

Ashwin N Bhanushali
  • 3,872
  • 5
  • 39
  • 59
3

You can't use vanilla Smack prior Smack 4 on Android. Have a look at "Android and XMPP: Currently available solutions"

Community
  • 1
  • 1
Flow
  • 23,572
  • 15
  • 99
  • 156
  • Hi Flow I used the same link to develop app what you have mentioned it uses smack lib can you suggest how do i solve this prob is there any other lib available – Ashwin N Bhanushali Oct 13 '11 at 06:36
  • Sorry, this should read "you can't use vanilla smack". I suggest googling for the various open source apps that use xmpp on android already and learn from them how to use asmack on android. An search on "xmpp" in the android market may be a good start. – Flow Oct 13 '11 at 06:57
  • I also updated my [answer](http://stackoverflow.com/questions/4769020/android-and-xmpp-currently-available-solutions/5487854#5487854) – Flow Oct 13 '11 at 07:14
0

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'
firasovich
  • 21
  • 2