6

プロジェクトの /libs/ ディレクトリに dnsjava.jar を持つ Android アプリがあります。すべてが正常にビルドされ、APK にパッケージ化できます (プロガードなし)。

ただし、proguard を project.properties (Eclipse) に導入すると、次の警告が表示されます。

[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)

-keep class org.xbill.** { *; の使用 proguard-project.txt の } はこれを解決していないようです。

4

1 に答える 1

5

これは、proguard と DNSJava でテストされています。それが役に立てば幸い。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
于 2014-05-20T14:55:43.093 に答える