-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeAdapters assertion looses causing throwable #737
Comments
Seems like disabling proguard will always simplify debugging. |
Not this time, though. I usually ran my tests on non-obfuscated proguard builds that share the same proguard configuration like my release builds, but this time the obfuscation was actually the issue that somehow made the field "vanish", because the proguarded debug build did not show the issue. Figured it out that I had a wrong OkHttp proguard configuration after I could hint myself at the missing field by using a custom gson build. Feel free to take this code over:
|
The AssertionError constructor with Throwable is added since Java 1.7 so it will be better to have only a detailed error message here. |
The detailed error message was added by #738 but because the constructor used in these changes does not exist in Java 6, it was later adjusted by #857 to only set the cause. |
Given how old this issue is and the summary from @Marcono1234 I'm going to close this now. Feel free to reopen or log a new issue if there is still a genuine issue here. |
In line https://github.com/google/gson/blob/master/gson/src/main/java/com/google/gson/internal/bind/TypeAdapters.java#L799
an
AssertionError
is thrown in case aNoSuchFieldException
is triggered. The assertion however looses all context information what field is missing and makes debugging this issue very hard, especially on proguarded builds.The text was updated successfully, but these errors were encountered: