Huỳnh Ngọc Bang
Huỳnh Ngọc Bang

Reputation: 1712

XMPP Android - Can't create MultiUserChat

I'm using asmack lastest version (now). And I can't create a MultiUserChat on Android.

This is what I get in the log:

E/AndroidRuntime( 558): java.lang.ClassCastException: org.jivesoftware.smack.packet.DefaultPacketExtension E/AndroidRuntime( 558): at org.jivesoftware.smackx.muc.MultiUserChat.getMUCUserExtension(MultiUserChat.java:2000) E/AndroidRuntime( 558): at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:364) ....

Who can help me solve this bug? Thanks!

Upvotes: 1

Views: 2704

Answers (3)

minicaptain
minicaptain

Reputation: 1216

when you want to create a MultiUserChat using smack, maybe you would come across some error! I suggested you to use asmack instead of smack on Android! you can get the asmack from github,https://github.com/flowdalic/asmack! you must make sure that you have red the README.md before you use it! when you want to call the api in every activity!you should call SmackAndroid.init(context) firstly! good luck!

besides that you much make sure that your room's name do not contain blank,when you want to create a multiuserchat or you maybe get odd errors!

Upvotes: 0

Jaspreet
Jaspreet

Reputation: 21

use muc.join(); directly insted of first using muc.create

Upvotes: 2

Flow
Flow

Reputation: 24043

Google is your friend, at least a quick search on the jive community forums.

I think that you have forgotten to register the Providers for XMPP Extensions. This gets normally done by smack via a config file, but this process is not possible on Android with asmack, so you need to do it explicitly.

Upvotes: 0

Related Questions