This is the third time I'm trying to get ProGuard to work.
My project is using LibGDX, and is built using Gradle.
The only library I'm using is Kryonet 2.21
.
When I run ProGuard, I add the generated .jar as an input. ProGuard automatically adds rt.jar
.
Shrinking and Optimization are enabled, Obfuscation is disabled (for now).
If I click process, the output contains A LOT of spam about missing classes, for example:
Warning: com.badlogic.gdx.utils.GdxBuild: can't find referenced class com.badlogic.gdx.jnigen.BuildTarget
Warning: org.lwjgl.opengl.ContextGLES: can't find referenced class org.lwjgl.opengles.EGL
Further down, something is going wrong with java.lang.String toString();
:
Maybe this is library method 'java.nio.FloatBuffer { java.lang.String toString(); }'
(and a LOT more of this spam).
Then some more, like Maybe this is program method 'org.lwjgl.openal.AL10 { void initNativeStubs(); }'
.
ProGuard presents me the following errors:
I have tried several "working" ProGuard configurations for LibGDX, like the one given on my previous question : LibGDX proguard, and https://github.com/libgdx/libgdx/wiki/ProGuard-DexGuard-and-libGDX .
If anyone could help me, I'd be forever grateful.
UPDATE:
I have been trying some more configurations. This is my current one:
-dontobfuscate
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-dontwarn android.support.**
-dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication
-dontwarn com.badlogic.gdx.utils.GdxBuild
-dontwarn com.badlogic.gdx.jnigen.BuildTarget*
-dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild
-keep class com.badlogic.gdx.controllers.android.AndroidControllers
-keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {
<init>(com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration);
}
# Kryo
-dontwarn sun.reflect.**
-dontwarn java.beans.**
-dontwarn sun.nio.ch.**
-dontwarn sun.misc.**
-keep class com.esotericsoftware.kryo.** {*;}
-keep class com.esotericsoftware.** {*;}
-keep class java.beans.** { *; }
-keep class sun.reflect.** { *; }
-keep class sun.nio.ch.** { *; }
The operation fails because of multiple of these exceptions: Uncaught translation error: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type float using a local variable of type int. This is symptomatic of .class transformation tools that ignore local variable information.
.