进口android.support不能得到解决
我试图运行code提供这里
我下载了code,从他们的Github上,并导入到Android SDK中,但它的线条显示误差
I am trying to run the code provided HERE
I downloaded the code from their Github and imported into Android SDK, but it shows error at the lines
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.NavUtils;
在多个文件。但是,如果我检查了Android SDK管理器中, Android的支持库
还有 Android的支持库
在Extras文件夹同时安装。我还可以看到支持文件夹和它的内容在 SDK_INSTALL \ SDK \演员\机器人\支持
目录。它也有其中还包含了 Android的支持 - v4.jar
和的src
文件夹中的文件夹V4。那么为什么它仍然显示错误,我怎么解决它,我怎么拿到样品code运行?样品code是一个RSS阅读器应用程序,如果是相关的。
in multiple files. However if I check the Android SDK Manager, the Android Support Library
as well as the Android Support Repository
in the Extras folder are both installed. I can also see the support folder and it's contents in the SDK_INSTALL\sdk\extras\android\support
directory. It also has the v4 folder which also contains the android-support-v4.jar
and the src
folder. THen why is it still showing the error, how do I resolve it and how do I get that sample code running? THe sample code is for an RSS reader app, if that's relevant.
请按以下步骤操作:
- 转到项目的
属性
- 导航到
Java构建路径
- 然后到
库
设置页。还有点击添加外部JAR
按钮在右窗格中。
- 选择
Android的支持 - v4.jar
文件,通常是在 Jar文件的路径是:
了Your_Drive \ Android的软件开发工具包\演员\机器人\ SUPPORT \ V4 \ Android的支持 - v4.jar 的
- 加入
的Andorid支持-v4.jar
库,导航到订单和出口
设置页,并把检查后标志上的Android的支持-V4
库文件。
- 做好以上,清理项目和构建它。
在
- 的问题解决了。的
- Go to your Project's
Properties
- Navigate to the
Java Build Path
- Then go to the
Libraries
tab. There click theAdd External JARs
Button on the Right pane.
- Select the
android-support-v4.jar
file, usually the path for the Jar file is :
YOUR_DRIVE\android-sdks\extras\android\support\v4\android-support-v4.jar
- After adding
andorid-support-v4.jar
Library, navigate to theOrder and Export
tab and put check mark on theandroid-support-v4
Library file.
- After doing the above, Clean the Project and Build it.
- Problem Solved.
对于这个问题的延伸阅读:
- Support Library - Android Dev
- what is android support library
- How Android Support Library work?
我希望这有助于。