-
Notifications
You must be signed in to change notification settings - Fork 306
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
Unable to create converter #214
Comments
Retrofit's stack trace mentions that the |
@aurae You are right, annotation processsor module is not added to gradle ,where my model classes are defined ,that's why its unable to generate JsonMapper .After adding it in that module gradle it works. But i have a doubt :- Earlier my all java classes are in a Model named module, which is defined as "java" moduloe in gradle (and it should be like that only as it contains only pure java classes), But just because of need of adding Annotation processor dependency, I have to make it a "Android" module with manifest and all . Although i have added annotation processor in my main android module dependency where this Model module is included , but still it works only when its added on the root module where the class is defined. Can there be any solution to that so that i dont have to make my Model java module with pure java classes only to a android module just because of annotation processor. |
You can totally use annotation processing in a pure-Java Gradle module! I used to recommend this plugin to folks for this (not sure about the current state of first-party support in the Java plugin). Apply it to your "models" module, then declare the LoganSquare processor as an |
Getting unable to create converter on using retrofit with logansquare as convertor . I have already added the apt and gradle dependency as given on homepage
Caused by: java.lang.IllegalArgumentException: Unable to create converter for java.util.List<com.chaayos.android.model.UnitBasicDetail> for method LoginService.getUnits at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:752) at retrofit2.ServiceMethod$Builder.createResponseConverter(ServiceMethod.java:738) at retrofit2.ServiceMethod$Builder.build(ServiceMethod.java:169) at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:170) at retrofit2.Retrofit$1.invoke(Retrofit.java:147) at java.lang.reflect.Proxy.invoke(Proxy.java:397) at $Proxy1.getUnits(Unknown Source) at com.chaayos.kettle.android.login.AssemblyLoginFragment.populateUnitsList(AssemblyLoginFragment.java:240) at com.chaayos.kettle.android.login.AssemblyLoginFragment.onCreateView(AssemblyLoginFragment.java:123) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617) at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:339) at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:601) at com.chaayos.kettle.android.assembly.AssemblyScreenActivity.onStart(AssemblyScreenActivity.java:214) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1244) at android.app.Activity.performStart(Activity.java:6108) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2491) ... 10 more Caused by: java.lang.IllegalArgumentException: Could not locate ResponseBody converter for java.util.List<com.chaayos.android.model.UnitBasicDetail>. Tried: * retrofit2.BuiltInConverters * com.github.aurae.retrofit2.LoganSquareConverterFactory at retrofit2.Retrofit.nextResponseBodyConverter(Retrofit.java:351) at retrofit2.Retrofit.responseBodyConverter(Retrofit.java:313) at retrofit2.ServiceMethod$Builder.createResponseConverter(ServiceMethod.java:736) ... 28 more
Below is the class
`
@JsonObject(fieldDetectionPolicy = JsonObject.FieldDetectionPolicy.NONPRIVATE_FIELDS_AND_ACCESSORS)
public class UnitBasicDetail {
}`
The text was updated successfully, but these errors were encountered: