Android and GSon

十年热恋 提交于 2019-12-13 03:54:44

问题


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();
}

回答1:


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?



来源:https://stackoverflow.com/questions/6947284/android-and-gson

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!