进口android.support不能得到解决 [英] The import android.support cannot be resolved

查看:185
本文介绍了进口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.

推荐答案

请按以下步骤操作:

  1. 转到项目的属性
  2. 导航到 Java构建路径
  3. 然后到设置页。还有点击添加外部JAR 按钮在右窗格中。
  4. 选择 Android的支持 - v4.jar 文件,通常是在 Jar文件的路径是:
    了Your_Drive \ Android的软件开发工具包\演员\机器人\ SUPPORT \ V4 \ Android的支持 - v4.jar
  5. 加入的Andorid支持-v4.jar 库,导航到订单和出口设置页,并把检查后标志上的 Android的支持-V4 库文件。
  6. 做好以上,清理项目和构建它。
  7. 问题解决了。
  1. Go to your Project's Properties
  2. Navigate to the Java Build Path
  3. Then go to the Libraries tab. There click the Add External JARs Button on the Right pane.
  4. 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
  5. After adding andorid-support-v4.jar Library, navigate to the Order and Export tab and put check mark on the android-support-v4 Library file.
  6. After doing the above, Clean the Project and Build it.
  7. Problem Solved.

对于这个问题的延伸阅读:

  1. 支持库 - Android开发
  2. Android是什么支持库
  3. 如何Android的支持库工作?
  1. Support Library - Android Dev
  2. what is android support library
  3. How Android Support Library work?

我希望这有助于。

这篇关于进口android.support不能得到解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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