hawk icon indicating copy to clipboard operation
hawk copied to clipboard

Hawk V2.0.1, illegal type variable reference

Open abdullahjhussein opened this issue 6 years ago • 4 comments

java.lang.AssertionError: illegal type variable reference at libcore.reflect.TypeVariableImpl.resolve(TypeVariableImpl.java:111) at libcore.reflect.TypeVariableImpl.getGenericDeclaration(TypeVariableImpl.java:125) at libcore.reflect.TypeVariableImpl.hashCode(TypeVariableImpl.java:47) at java.util.Arrays.hashCode(Arrays.java:4074) at com.google.gson.internal.$Gson$Types$ParameterizedTypeImpl.hashCode(SourceFile:1) at com.google.gson.reflect.TypeToken.(SourceFile:4)

I had this crash in release mode, when try to put ArrayList of object in hawk. Also, i add Progaurd rules related Hawk lib

we use Hawk: V2.0.1 Gson: V2.8.5

abdullahjhussein avatar May 16 '19 09:05 abdullahjhussein

decision https://github.com/orhanobut/hawk/issues/195#issuecomment-455837851

alexeygron avatar May 18 '19 06:05 alexeygron

I had the same issue, this Proguard rule had fixed my problem -keep class com.orhanobut.hawk.** { *; } I was getting custom objects map from Hawk

Hawk.get<MutableMap<String, Request>>(REQUESTS_KEY) //<-- CRASH HERE

@Keep
internal data class Request(
    val objId: String,
    val objectClass: UploadClass,
    val extra: Map<String, String> = emptyMap()
)

@Keep
internal enum class UploadClass {
    TYPE_ONE, TYPE_TWO
}

lemberh avatar Jun 19 '19 15:06 lemberh

@lemberh You saved my day. thk

mezhevikin avatar Jan 19 '20 10:01 mezhevikin

thanks

ahan530 avatar Feb 04 '21 01:02 ahan530