Android的Studio和android.support.v4.app.Fragment:不能解析符号 [英] Android Studio and android.support.v4.app.Fragment: cannot resolve symbol

查看:1178
本文介绍了Android的Studio和android.support.v4.app.Fragment:不能解析符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我tryng了Android的工作室,而不是Eclipse的。我安装它,然后开始一个全新的项目,并按照向导。添加我没有自己的code。

I am tryng out Android Studio instead of Eclipse. I install it and then start a completely new project and follow the wizard. I add no code of my own.

然后,我单击右键创建一个新的组件,新的片段:

Then, I right-click to create a new component, a new Fragment:

和选择一个新的片段:

和,只要我做的,我看到的编译错误:

and as soon as I do, I see compile errors:

...所以我开始使用Google,并找出我需要安装和参考支持库4 < /一>,和我做。当我检查build.gradle(whatver也就是说,新的我从Eclipse的未来),我看到:

... so I start googling and find out that I need to install and reference support library 4, and that I do. When I check the build.gradle (whatver that is, new to me coming from Eclipse), I see:

但我把它修改成

因为他们这么说这里。重新编译和所有的错误后,错误仍然存​​在。然后我直接引用的.jar文件,像这样的:

because they said so here. After recompiling and all that, the error is still there. I then reference the .jar-file directly, like this:

和再做重新编译内容十分重要,但是,这并不帮助的。

and again do recompile yada yada, but that doesnt help either.

此行​​为似乎很奇怪,我。我在想什么吗?这是SDK管理器视图:

This behaviour seems very strange to me. What am I missing here? This is the SDK Manager view:

所以,我缺少什么?谢谢=)

推荐答案

此问题的症状通常是构建工作正常,在命令行(这意味着你的 build.gradle 文件树立正确的),但你在IDE中的语法高亮显示错误。解决的方法是单击工具栏上的同步工程与摇篮文件按钮。我们意识到这是不太理想的IDE不能只是采取强迫你在合适的时间来手动同步的关怀本身,而不是;我们正在跟踪进展这<一href="https://$c$c.google.com/p/android/issues/detail?id=63151">https://$c$c.google.com/p/android/issues/detail?id=63151

The symptom of this problem is usually that the build works fine from the command line (which means your build.gradle file is set up right) but you get syntax highlighting errors in the IDE. The solution is to click the Sync Project with Gradle Files button in the toolbar. We realize it's less than ideal that the IDE can't just take care of itself instead of forcing you to manually sync at the right time; we're tracking progress on this in https://code.google.com/p/android/issues/detail?id=63151

这篇关于Android的Studio和android.support.v4.app.Fragment:不能解析符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆