vidar
vidar

Reputation: 11

Proguard obfuscation fails with tinylog

I am using Proguard together with TinyLog. The following are defined in the proguard.conf file as it was stated on the Tinylog home page

-keepnames interface org.tinylog.**
-keepnames class * implements org.tinylog.**
-keepclassmembers class * implements org.tinylog.** { <init>(...); }

The following error messages are from the obfuscation process:

[proguard] Note: there were 1 duplicate class definitions.
[proguard]       (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
[proguard] Warning: there were 2 classes in incorrectly named files.
[proguard]          You should make sure all file names correspond to their class names.
[proguard]          The directory hierarchies must correspond to the package hierarchies.
[proguard]          (http://proguard.sourceforge.net/manual/troubleshooting.html#unexpectedclass)
[proguard]          If you don't mind the mentioned classes not being written out,
[proguard]          you could try your luck using the '-ignorewarnings' option.
[proguard] Error: Please correct the above warnings first. 

Does anyone know how to correct the errors ?

I am using tinylog 2.4.1

Using -ignorewarnings in proguard.conf is not an option

Upvotes: 1

Views: 122

Answers (1)

Martin
Martin

Reputation: 716

Here is a minimal Android App example project that uses tinylog 2 for logging and ProGuard for obfuscation: https://github.com/tinylog-org/tinylog-android-example. The latest stable version of Android build tools for Gradle (com.android.tools.build:gradle:7.1.0) does not output the posted warnings.

If you have to use an old version ProGuard or a custom ProGuardTask in your Gradle script, you can remove the module-info files as described here: META-INF/version duplicate error when using Proguard

Upvotes: 0

Related Questions