简体   繁体   中英

Smack xmpp - Establishing a Connection

I just followed the getting started codes of Smack Xmpp 4.2.4 and I encountered this error. I was able to import the jar files needed. Can anyone help me? Here are the errors.

The type org.jxmpp.stringprep.XmppStringprepException cannot be resolved. It is indirectly referenced from required .class files The method setXmppDomain(String) from the type ConnectionConfiguration.Builder refers to the missing type XmppStringprepException

Getting started code that I followed

    XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
      .setUsernameAndPassword("username", "password")
      .setXmppDomain("192.168.0.1")
      .setPort("5222")
      .build();

    AbstractXMPPConnection con = new XMPPTCPConnection(config);
    con.connect().login();

You have to put the jxmpp-core, jxmpp-util-cache,jxmpp-jid JAR files into your project. JXMPP Github You may have other issues later, better read Smack4.2 Readme .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM