ProGuard, version 7.2.2
Note: com.google.gson.internal.$Gson$Types$ParameterizedTypeImpl calls 'Class.getEnclosingClass'
Note: org.eclipse.jetty.client.util.AbstractRequestContent$AbstractSubscription calls 'Class.getEnclosingClass'
Warning: org.eclipse.jetty.util.TypeUtil: can't find referenced method 'java.net.URI invoke(java.lang.Class)' in library class java.lang.invoke.MethodHandle
Note: com.google.gson.internal.UnsafeAllocator: can't find dynamically referenced class sun.misc.Unsafe
Note: com.google.gson.internal.reflect.UnsafeReflectionAccessor: can't find dynamically referenced class sun.misc.Unsafe
Note: com.google.gson.internal.ConstructorConstructor accesses a declared constructor '<init>()' dynamically
Note: com.google.gson.internal.UnsafeAllocator accesses a declared field 'theUnsafe' dynamically
Note: com.google.gson.internal.UnsafeAllocator accesses a method 'allocateInstance(java.lang.Class)' dynamically
Note: com.google.gson.internal.reflect.UnsafeReflectionAccessor accesses a method 'objectFieldOffset(java.lang.reflect.Field)' dynamically
Note: com.google.gson.internal.reflect.UnsafeReflectionAccessor accesses a method 'putBoolean(java.lang.Object,long,boolean)' dynamically
Note: com.google.gson.internal.reflect.UnsafeReflectionAccessor accesses a declared field 'theUnsafe' dynamically
Note: org.eclipse.jetty.util.DecoratedObjectFactory accesses a declared constructor '<init>()' dynamically
Note: org.eclipse.jetty.util.IncludeExcludeSet accesses a declared constructor '<init>()' dynamically
Note: org.eclipse.jetty.util.IncludeExcludeSet accesses a declared constructor '<init>()' dynamically
Note: org.eclipse.jetty.util.ManifestUtils accesses a method 'getModule()' dynamically
Note: org.eclipse.jetty.util.ManifestUtils accesses a method 'getDescriptor()' dynamically
Note: org.eclipse.jetty.util.ManifestUtils accesses a method 'rawVersion()' dynamically
Note: org.eclipse.jetty.util.TypeUtil accesses a constructor '<init>(java.lang.String)' dynamically
Note: org.slf4j.helpers.SubstituteLogger accesses a method 'log(org.slf4j.event.LoggingEvent)' dynamically
Warning: there were 1 unresolved references to library class members.
You probably need to update the library versions.
(https://www.guardsquare.com/proguard/manual/troubleshooting#unresolvedlibraryclassmember)
Unexpected error
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:544) ~[proguard.jar:7.2.2]
at proguard.pass.PassRunner.run(PassRunner.java:24) ~[proguard.jar:7.2.2]
at proguard.ProGuard.initialize(ProGuard.java:328) ~[proguard.jar:7.2.2]
at proguard.ProGuard.execute(ProGuard.java:130) ~[proguard.jar:7.2.2]
at proguard.ProGuard.main(ProGuard.java:614) [proguard.jar:7.2.2]
I have tried to trace the mentioned methods in the libraries and they are present. I have also tried -dontwarn java.lang.* which then produces the output jar file but then the error shows up in runtime. Any help would be greatly appreciated, thank you.
Here is my configuration file:
-injars /home/coder/Desktop/bots/main.jar
-outjars /home/coder/Desktop/bots/release/main.jar
-libraryjars <java.home>/jmods/java.base.jmod(!**.jar;!module-info.class)
-keep public class com.koala.Main {
public static void main(java.lang.String[]);
}
#-dontwarn org.slf4j.**
#-keep class org.eclipse.jetty.http.** { *; }
#-keep public class com.google.gson
#-ignorewarnings
-target 11
-keepclassmembers class * extends java.lang.Enum {
<fields>;
public static **[] values();
public static ** valueOf(java.lang.String);
}
#-keep class java.lang.invoke.MethodHandle.** { *; }
#-keep class java.net.URI.** { *; }
#-keep class org.eclipse.jetty.util.TypeUtil.** { *; }
# -----------------Other configurations--------------------------
-dontwarn java.sql.**
-dontwarn java.awt.**
-dontwarn java.net.**
#-dontwarn java.lang.**
-dontwarn javax.xml.**
-dontwarn javax.naming.**
-dontwarn javax.imageio.**
-dontwarn org.ietf.**
-dontwarn org.w3c.dom.**
-dontwarn org.eclipse.jetty.jmx.**
-dontwarn org.eclipse.jetty.client.jmx.**
##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# For using GSON @Expose annotation
#-keepattributes Annotation
-keepattributes *Annotation*
# Gson specific classes
-dontwarn sun.misc.**
-keep class com.google.gson.stream.** { *; }
# Application classes that will be serialized/deserialized over Gson
#keep class com.google.gson.examples.android.model.** { <fields>; }
-keep class com.koala.AccountSetup.** { *; }
-keep class com.koala.Accounts.** { *; }
-keep class com.koala.Order.** { *; }
-keep class com.koala.Orders.** { *; }
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
##---------------End: proguard configuration for Gson ----------