I am trying to create a simple News app with the following endpoint:
I know there are 2-3 questions already on SO about this but I belive that this exception is unique since it can not create a constructor for a library interace?!...
Here are my project files:
I get the following RuntimeException when trying to call
call.enqueue(new Callback<News>() {
In the main activity:
Unable to invoke no-args constructor for interface retrofit2.http.Body. Registering an InstanceCreator with Gson for this type may fix this problem.
So far I have tried:
Creating no-arg constructors for each of my model classes as mentioned in another similar question
Checking whether the any of the classes share similar names with the retrofit interace as mentioned here and here
Any idea what could cause this? I belive my code should be working and since the error is with a the retrofit2.http.Body
interface which to my knowledge I should not have to implement anywhere...
I really appreciate any form of help! Thanks!