Closed mirmousaviii closed 7 years ago
Here is a boilerplate code for a moshi converter factory:
public static Converter.Factory createMoshiConverterFactory() {
Moshi moshi = new Moshi.Builder()
.add(ResourceAdapterFactory.builder()
.add(Credential.class)
.add(Event.class)
.add(Notification.class)
.add(Order.class)
.add(Product.class)
.add(Session.class)
.add(User.class)
.add(AnyModelClassYouNeed.class)
.build())
.add(Date.class, new Rfc3339DateJsonAdapter())
.build();
return MoshiConverterFactory.create(moshi);
}
I'd add that to documentation ASAIC.
Thank you. It's resolved with your code. And I find other solution same your answer.
ResourceAdapterFactory is not resolved.
@senthilkumar06 can you check if the library is correctly added to the project?
Cannot resolve symbol 'MoshiConverterFactory'
TokenModel.java
TestService.java:
TestProvider.java:
If I use MoshiConverterFactory make error
Unable to create converter for class com.xxxx.xxxx.model.TokenModel!
Use Retrofit: