Android的Eclipse的错误:" GSON不能被解析为一个类型" [英] Android Eclipse Error: "Gson cannot be resolved to a type"
问题描述
我是比较新的的Java,Eclipse和Android的所以这可能是一个完全愚蠢的问题,但我要问它没有少。
I'm relatively new to Java, eclipse and android so this could be a completely silly question, but I'm going to ask it none the less.
我有一个项目,我正在学习用,以测试连接到Flickr的API和简单显示最近的图像。我在现在,我想解析JSON从Flickr接收点。我已经下载GSON 1.4,并通过添加压缩到Java构建路径添加外部JAR。它的成功加载,我可以看到在包浏览器中引用的库谷歌-GSON。我的问题是,当我尝试使用它,我只是得到一个错误。
I've got a project I'm learning with to test connecting to the flickr api and simply displaying recent images. I'm at the point now where I want to parse the JSON received from flickr. I've downloaded gson 1.4 and added the zip to the java build path through "add external jars." It's successfully loaded and I can see google-gson under referenced libraries in the package explorer. My problem is, when I try to use it, I simply get an error.
GSON GSON =新GSON();
Gson gson = new Gson();
它强调GSON并说:GSON不能被解析为一个类型。我在想什么吗?它的工作一次,一直停止。我试着取下罐,清洗项目,重新添加罐子,但它仍然无法正常工作。
It highlights Gson and says that "Gson cannot be resolved to a type." What am I missing here? It worked once and has since stopped. I've tried removing the jars, cleaning the project and re-adding the jars but it still doesn't work.
我只是完全noobing这件事还是有其他问题?
Am I just completely noobing this up or is there another problem?
推荐答案
我不知道到底为什么这工作,但我提取的拉链和刚添加GSON-1-4.jar,它似乎已经奏效。
I'm not sure exactly why this worked but I extracted the zip and just added gson-1-4.jar and it appears to have worked.
万岁!
这篇关于Android的Eclipse的错误:" GSON不能被解析为一个类型"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!