bluelinelabs / bluelinelabs/LoganSquare

ParameterizedType proguard runtime error

Open
#171 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.2k
Forks
303
PR merge metrics
No merged PRs in 30d

Description

My code works in debug mode (not proguard)

My code

```
public static ResponseServer generateJSON(String json, Class dataClass){
ResponseServer responseServer = null;
if (dataClass == JUnidade.class)
responseServer = (ResponseServer)LoganSquare.parse(json, new ParameterizedType>() { });
....

```

my rules of proguard-rules.pro

```
-keep class com.mypackage.myapp.WebService.Models.ResponseServer.**

-keep class * extends com.bluelinelabs.logansquare.ParameterizedType.**

-keepclassmembers class com.mypackage.myapp.WebService.Models.** {*;}

-keep public class com.mypackage.myapp.WebService.Models.** {
public static ;
}
```

Decompiled in debug mode (not run proguard) It's Work

![original](https://cloud.githubusercontent.com/assets/19416775/17626239/cd2fe78c-6082-11e6-9211-fc7b8a2ee3e1.png)

Decompiled in release mode (run proguard) don't work

![erro](http://i.stack.imgur.com/qFXog.png)

any suggestion?

My question in [stackoverflow](http://stackoverflow.com/questions/38920279/runtime-error-in-generic-method-with-proguard)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the generateJSON method and the rules in proguard-rules.pro, then compare the debug and ProGuard release behavior described in the issue. Reproduce the runtime failure in a release build and verify that the ParameterizedType-based LoganSquare parsing works there without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.