ron
ron

Reputation: 5279

Android and GSon

I am starting to look at google's Gson. The following code errors as it is entered in that the Gson in the last line is not recognised. The imports are ok so what am I missing?

import com.google.gson.*;
import com.google.gson.stream.*;

public class BuildJsonObject {
    Gson myGson = new Gson();
}

Upvotes: 0

Views: 791

Answers (1)

Evan
Evan

Reputation: 1737

Did you add the GSON Jar to your build path?

Right Click (Project) -> Build Path -> Configure Build Path... -> Go To 'Libraries' Tab -> Click 'Add External JARs...' then select the GSON jar file?

enter image description here

Upvotes: 5

Related Questions