Closed eakteam closed 4 years ago
LdTb;
Is there some code obfuscation tool involved? Am I right to assume you are using MiniDNS 0.3.3?
@Flowdalic The crash is happening on minidns-client:0.4.0-alpha3
. Also i have checked to in my R8/Proguard rules, already added : -keep class org.minidns.dnsserverlookup.**
, but it is still crashing, i don't know why.
The crash on firebase/crashlytics/logs says :
Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: LCv1;
at org.minidns.dnsserverlookup.AndroidUsingExec.isAvailable(AndroidUsingExec.java:61)
at org.minidns.DnsClient.addDnsServerLookupMechanism(DnsClient.java:399)
at org.minidns.DnsClient.(SourceFile:4)
Caused by java.lang.ClassNotFoundException: Didn't find class "Cv1" on path: DexPathList[[
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at org.minidns.dnsserverlookup.AndroidUsingExec.isAvailable(AndroidUsingExec.java:61)
at org.minidns.DnsClient.addDnsServerLookupMechanism(DnsClient.java:399)
at org.minidns.DnsClient.(SourceFile:4)
Does it also crash if you completely disable ProGuard?
@Flowdalic , when i am testing on debug mode, the crash don't happen immediately and not always. But sometimes yes it does crash Anyway as i said, i have added keep rules
For Android > API 21 if i add on Application Class : DnsClient.addDnsServerLookupMechanism(AndroidUsingLinkProperties.setup(this)
, it is crashing immediately when applying R8 or Proguard
It is weird because in rules i have added as i said : -keep class org.minidns.dnsserverlookup.**
, but i will try -keep class org.minidns.dnsserverlookup.** { *; }
and will get back to you again to see what happens
when i am testing on debug mode, the crash don't happen immediately and not always. But sometimes yes it does crash
How does the (non-obfuscated) stacktrace look like if ProGuard is disabled?
@Flowdalic I will try and will get back to this again. Thanks for your support. Also i will dissable obfuscation if it crash again to get more detailed crash report .
@Flowdalic , when i apply R8/Proguard but adding this -dontobfuscate
, it is not crashing anymore. I don't understand why because in fact even if i apply obfuscations still have added keep rules for -keep class org.minidns.dnsserverlookup.** { *; }
and it should not obfuscate it.
I understand that this maybe is not bug of this library itself, but maybe something can be refactored to better function ?
Best Regards
With obfuscation enabled this is my rules which everything works OK.
-keep, allowoptimizationclass org.minidns.dnsserverlookup.**
-keep, allowoptimization class org.minidns.DnsClient //Adding this second line solve the issue
You can close this issue if nothing can be done through the library itself to better initialize classes
Hi, everything was going fine before. After adding some native libs on my app it is throwing this exception :
I am using compileSdkVersion 28