google / gson

A Java serialization/deserialization library to convert Java Objects into JSON and back
Apache License 2.0
23.25k stars 4.27k forks source link

new Proguard errors #1174

Open ncapdevi opened 6 years ago

ncapdevi commented 6 years ago

Warning: library class com.google.gson.Gson$6 extends or implements program class com.google.gson.TypeAdapter Warning: library class com.google.gson.Gson$6 depends on program class com.google.gson.stream.JsonWriter Warning: library class com.google.gson.Gson$6 depends on program class com.google.gson.stream.JsonReader Warning: library class com.google.gson.Gson$6 depends on program class com.google.gson.stream.JsonReader Warning: library class com.google.gson.Gson$6 depends on program class com.google.gson.stream.JsonWriter

And this is with using the proguard suggested in https://github.com/google/gson/blob/master/examples/android-proguard-example/proguard.cfg

tasomaniac commented 6 years ago

it's funny that it is also the same error for us with $6. -dontwarn works for us.

ychescale9 commented 6 years ago

Are you guys using android gradle plugin 3.0? I got the same error with 3.0-RC2 and -dontwarn works

ncapdevi commented 6 years ago

What exactly does your -dontwarn look like?

tasomaniac commented 6 years ago

-dontwarn com.google.gson.Gson$6

deeparav commented 6 years ago

I now face the same issue after upgrading the gradle plugin to ‘3.0.0’ and support Lib to 27 on Android studio . The suggested solution did not work for me . @ncapdevi , any solutions which helped you ?

wnchen commented 6 years ago

I was replacing compile with implementation and api, i ran into this issue with release build, too. -dontwarn com.google.gson.Gson$6 works for me

Marcono1234 commented 1 month ago

Could you please try the latest Gson version and see if the same warnings are still reported? The android-proguard-example/proguard.cfg has been improved in the meantime, and since Gson 2.11.0 a default gson.pro file is provided.