简体   繁体   中英

Smack XMPP android Crash on Connecting

I am using Smack XMPP for an Android app previously every thing was working perfectly smooth except this morning it just starts crashing for no reason. Here is what I am including in Gradle:

compile 'org.igniterealtime.smack:smack-android:4.2.0'
compile 'org.igniterealtime.smack:smack-tcp:4.2.0'
compile 'org.igniterealtime.smack:smack-android-extensions:4.2.0' 

and the log is printing this error

java.lang.ExceptionInInitializerError at de.measite.minidns.DNSName.from(DNSName.java:287) at de.measite.minidns.dnssec.DNSSECClient.(DNSSECClient.java:48) at de.measite.minidns.hla.DnssecResolverApi.(DnssecResolverApi.java:47) at de.measite.minidns.hla.DnssecResolverApi.(DnssecResolverApi.java:38) at de.measite.minidns.hla.DnssecResolverApi.(DnssecResolverApi.java:31) at org.jivesoftware.smack.util.dns.minidns.MiniDnsResolver.(MiniDnsResolver.java:54) at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:324) at org.jivesoftware.smack.SmackInitialization.loadSmackClass(SmackInitialization.java:218) private static final DNSName DEFAULT_DLV = DNSName.from("dlv.isc.org");

on this line

  XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration
                .builder();

I searched alot but couldn't find any thing.

Thanks

Hi I got this issue too.

The issue comes from one dependency "de.measite.minidns" that pushed an update with a bug. So I fixed it like that by excluding to auto-dependency and including the last stable release. It fixed my problem. Hope it works for you guys

    compile ('org.igniterealtime.smack:smack-android:4.2.0') {
      exclude  group:'de.measite.minidns'
    }
    compile ('org.igniterealtime.smack:smack-tcp:4.2.0') {
      exclude  group:'de.measite.minidns'
    }
    compile group: 'de.measite.minidns', name: 'minidns-hla', version: 
    '0.2.2'
dependencies {

compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
//open due to the need to get offline messages
compile 'org.igniterealtime.smack:smack-extensions:4.2.0'
compile 'org.igniterealtime.smack:smack-im:4.2.0'

compile  ('org.igniterealtime.smack:smack-android:4.2.0') {
    exclude  group:'de.measite.minidns'
}


compile 'org.igniterealtime.smack:smack-experimental:4.2.0'

// Optional for XMPPTCPConnection
compile ('org.igniterealtime.smack:smack-tcp:4.2.0') {
    exclude  group:'de.measite.minidns'
}

compile group: 'de.measite.minidns', name: 'minidns-hla', version:
        '0.2.2'
}

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