Moshi: When given a Class, look for static ToJson/FromJson methods.

Created on 20 Mar 2016  路  2Comments  路  Source: square/moshi

Current behavior:

Exception in thread "main" java.lang.IllegalArgumentException: Expected at least one @ToJson or @FromJson method on java.lang.Class
    at com.squareup.moshi.AdapterMethodsFactory.get(AdapterMethodsFactory.java:129)
    at com.squareup.moshi.Moshi$Builder.add(Moshi.java:186)

Most helpful comment

-keepclassmembers class ** {
    @com.squareup.moshi.FromJson *;
    @com.squareup.moshi.ToJson *;
}

from https://github.com/square/moshi/issues/93 solved this for me

All 2 comments

-keepclassmembers class ** {
    @com.squareup.moshi.FromJson *;
    @com.squareup.moshi.ToJson *;
}

from https://github.com/square/moshi/issues/93 solved this for me

@WingedToaster that is unrelated to this issue

Was this page helpful?
0 / 5 - 0 ratings