powered by Jive Software

Smack 4.2.0 suddenly started crashing in Android

cause of error is this line:

XMPPTCPConnectionConfiguration.builder()

The error message is this:

java.lang.ExceptionInInitializerError

java.lang.IllegalArgumentException: U_IDNA_ZERO_LENGTH_LABEL_ERROR

Is this due to some changes made to 4.2.0?

Please let me know how to resolve this issue.

Thanks in advance.

I also got same problem.

App kept on crashing after i rebuild the project in android studio.The error is in the line:

XMPPTCPConnectionConfiguration.builder();

The error message is :

E/AndroidRuntime: FATAL EXCEPTION: Thread-2

java.lang.ExceptionInInitializerError

Caused by: java.lang.IllegalArgumentException: Invalid input to toASCII: .

Caused by: Found zero length lable after NamePrep… line: 0. preContext: . postContext:

I have added the following in my app gradle:

compile ‘org.igniterealtime.smack:smack-android-extensions:4.2.0’

compile ‘org.igniterealtime.smack:smack-tcp:4.2.0’

Very weird! I am also getting same issue when I build my smack project early today but the build I made yesterday is working fine without any exceptions!

I am also using Smack 4.2.0 and also tried 4.2.1-SNAPSHOT but no luck

compile "org.igniterealtime.smack:smack-android-extensions:4.2.0"
compile "org.igniterealtime.smack:smack-experimental:4.2.0"
compile(“org.igniterealtime.smack:smack-tcp:4.2.0”)

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.(MiniDnsResolve r.java:54)

at java.lang.Class.classForName(Native Method)

at java.lang.Class.forName(Class.java:400)

at org.jivesoftware.smack.SmackInitialization.loadSmackClass(SmackInitialization.j ava:218)

at org.jivesoftware.smack.SmackInitialization.parseClassesToLoad(SmackInitializati on.java:198)

at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitializatio n.java:168)

at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitializatio n.java:153)

at org.jivesoftware.smack.SmackInitialization.(SmackInitialization.java:11 9)

at org.jivesoftware.smack.SmackConfiguration.getVersion(SmackConfiguration.java:96 )

at org.jivesoftware.smack.provider.ProviderManager.(ProviderManager.java:1 21)

at org.jivesoftware.smack.provider.ProviderManager.addExtensionProvider(ProviderMa nager.java:259)

Caused by: java.lang.IllegalArgumentException: Invalid input to toASCII: .

at java.net.IDN.toASCII(IDN.java:112)

at java.net.IDN.toASCII(IDN.java:134)

at de.measite.minidns.idna.DefaultIdnaTransformator.toASCII(DefaultIdnaTransformat or.java:19)

at de.measite.minidns.idna.MiniDnsIdna.toASCII(MiniDnsIdna.java:18)

at de.measite.minidns.DNSName.(DNSName.java:103)

at de.measite.minidns.DNSName.(DNSName.java:59)

Caused by: Found zero length lable after NamePrep… line: 0. preContext: . postContext:

at android.icu.impl.IDNA2003.convertToASCII(IDNA2003.java:185)

at android.icu.impl.IDNA2003.convertIDNToASCII(IDNA2003.java:275)

at android.icu.text.IDNA.convertIDNToASCII(IDNA.java:652)

I got the same problem and I could solve it by adding this line:

SmackConfiguration.addDisabledSmackClass(“org.jivesoftware.smack.util.dns.minidns.MiniDnsResolver”)

It is disabling the MiniDNSResolver, which is causing the problem.

I hope it helps.

I got this issue too.

The issue comes from one dependency de.measite.minidns that pushed a 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’

1 Like

Thanks dams! nice catch!

This is fixed with MiniDNS 0.2.4. Your build system will automatically pick up the latest version, no manual intervention should be required.