6

I have an android app which has dnsjava.jar in the /libs/ directory of the project. Everything built fine and can be packaged into APK (without proguard).

However, when i introduced proguard into the project.properties (in eclipse), i get the following warnings:

[2013-03-07 14:16:08 - ] Proguard returned with error code 1. See console
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.DNSJavaNameServiceDescriptor: can't find superclass or interface sun.net.spi.nameservice.NameServiceDescriptor
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.DNSJavaNameServiceDescriptor: can't find referenced class sun.net.spi.nameservice.NameService
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.DNSJavaNameServiceDescriptor: can't find referenced class sun.net.spi.nameservice.NameServiceDescriptor
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.DNSJavaNameServiceDescriptor: can't find referenced class sun.net.spi.nameservice.NameService
[2013-03-07 14:16:08 - ] Warning: org.xbill.DNS.spi.DNSJavaNameServiceDescriptor: can't find referenced class sun.net.spi.nameservice.NameService
[2013-03-07 14:16:08 - ]       You should check if you need to specify additional program jars.
[2013-03-07 14:16:08 - ] Warning: there were 5 unresolved references to classes or interfaces.
[2013-03-07 14:16:08 - ]          You may need to specify additional library jars (using '-libraryjars').
[2013-03-07 14:16:08 - ] java.io.IOException: Please correct the above warnings first.
[2013-03-07 14:16:08 - ]    at proguard.Initializer.execute(Initializer.java:321)

Using -keep class org.xbill.** { *; } in proguard-project.txt does not seem to solve this.

4
  • Hi how you enable proguard settings to your App in eclipse........ Commented Mar 7, 2013 at 6:31
  • Hmm, reading around, and found that adding a -dontwarn org.xbill.** seems to solve the problem. Heck... Commented Mar 7, 2013 at 6:36
  • Try adding the -dontwarn tag in your proguard.config file. Commented Mar 7, 2013 at 6:38
  • Also do not obfuscate the classes in which you are using library dnsjava.jar just keep it as it is like -keep class sun.net.spi.nameservice.NameService { *; } Commented Mar 7, 2013 at 6:47

1 Answer 1

5

This is tested with proguard & DNSJava. Hope it helps. Copied from asmack readme

# This dnsjava class uses old Sun API
-dontnote org.xbill.DNS.spi.DNSJavaNameServiceDescriptor
-dontwarn org.xbill.DNS.spi.DNSJavaNameServiceDescriptor

# See http://stackoverflow.com/questions/5701126, happens in dnsjava
-optimizations !code/allocation/variable
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.