bluelinelabs / LoganSquare

Screaming fast JSON parsing and serialization library for Android.
Apache License 2.0
3.21k stars 306 forks source link

[help] - ERROR - could not be mapped to a JSON object #201

Closed MSay2 closed 7 years ago

MSay2 commented 7 years ago

Hello, please help me I receive this error in my LogCat

com.bluelinelabs.logansquare.NoSuchMapperException: Class com.msay2.ilion.item_data.WallpaperJSON could not be mapped to a JSON object. Perhaps it hasn't been annotated with @JsonObject?

My java file:

import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;

import java.util.List;

@JsonObject
public class WallpaperJSON 
{
    @JsonField(name = "Wallpapers")
    public List<WallpaperJSON> getWalls;

    @JsonField(name = "name")
    public String name;

    @JsonField(name = "author")
    public String author;

    @JsonField(name = "url")
    public String url;

    @JsonField(name = "thumburl")
    public String thumbUrl;
}
VitorFontenelle commented 6 years ago

How did you solve it?

MSay2 commented 6 years ago

I did not solve it, being out of ideas, I turned to a much simpler method (without using external libraries)

I use these imports

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
yakphi commented 6 years ago

The recursive class dependecy looks like suspectious.