AnsweredAssumed Answered

Smack 4.1.3 Crash

Question asked by Flameater Flameater on Jul 16, 2015
Latest reply on Aug 21, 2015 by silenceleaf

Hi guys, I'm getting Smack crashes consistently on various combinations of platforms and versions that it's truly mind boggling


1. Platforms (crash on either one of both)

     a. Android SDK 22

     b. Java 8


2. Smack versions (crash either one of both)

     a. Smack 4.1.3

     b. Smack 4.2.0 Alpha


Code runs Smack in an independent thread, just to be safe. Despite that, Smack would crash upon instantiation of any Smack object even before any invocation of method is carried, refer source code below


Crash upon initialization of XMPPTCPConnectionConfiguration.Builder

XMPPTCPConnectionConfiguration.Builder connconfig = XMPPTCPConnectionConfiguration.builder(); //Crash here, because the rest of codes are commented out below
//connconfig.setUsernameAndPassword(strUserId+ "@" + strServer, strPassword);

mConnection = new XMPPTCPConnection(;
try {
} catch (SmackException | IOException | XMPPException e) {


Alternatively, Smack would crash upon initialization of

ConnectionConfiguration connconfig = new ConnectionConfiguration(strServer); //Crash here, because the rest of codes are commented out below
// connconfig.setDebuggerEnabled(true);
// XMPPConnection connection = new XMPPConnection(connconfig);

try {
} catch (XMPPException e) {
  retStr = e.getMessage();

// Most servers require you to login before performing other tasks.
try {
  connection.login(strUserId, strPassword);
catch (XMPPException e) {
  retStr = e.getMessage();



Apart from my own projects, the Xabber source codes would also crash upon initialization of Smack objects.


I couldn't find anyone else having crashes so widespread like these - different platforms, different Smack versions, different Smack entry points. I'm stumped now for ideas, hope someone can see some light to this.


Thanks in advance!