简体   繁体   English

无法将android.support.v7添加到我的项目构建路径

[英]Cannot add android.support.v7 to my project build path

I am trying to add android-support-v7-appcompat to my project build path: 我想将android-support-v7-appcompat添加到我的项目构建路径:

This is what I have done: Right-click on my own project -> build path -> configure build path -> choose Android on the left column and then click "Add". 这就是我所做的:右键单击我自己的项目 - >构建路径 - >配置构建路径 - >在左栏中选择Android,然后单击“添加”。 I choose "android-support-v7-appcompat". 我选择“android-support-v7-appcompat”。 This name appears then in the right column of the table, on the left appears the path where the library is located: C:\\Program Files\\adt-bundle-windows-x86-20131030\\sdk\\extras\\android\\support\\v7\\appcompat. 此名称出现在表格的右栏中,左侧显示库所在的路径:C:\\ Program Files \\ adt-bundle-windows-x86-20131030 \\ sdk \\ extras \\ android \\ support \\ v7 \\程序兼容性。 And it has a beautiful green check mark on the left! 它的左侧有一个漂亮的绿色复选标记

I click Apply or Ok. 我点击Apply或Ok。

Then I go to this screen again, but though the path is still on the left in the table, there is a red cross on the left and a question mark, where "android-support-v7-appcompat" should have been. 然后我再次进入这个屏幕,但是虽然路径仍然在表格的左边,但左边有一个红叉 ,还有一个问号,“android-support-v7-appcompat”应该是。 I have done exactly what is described in http://developer.android.com/tools/support-library/setup.html (title "Adding libraries with resources"). 我完全按照http://developer.android.com/tools/support-library/setup.html (标题为“使用资源添加库”)中的描述进行了操作。

Has someone any idea???? 有人有什么想法????

the way how to preserve "green check mark" after reopen Properties window is putting your own project on the same letter drive, where is located project android-support-v7-appcompat 重新打开属性窗口后如何保留“绿色复选标记”的方法是将您自己的项目放在同一个字母驱动器上,位于项目android-support-v7-appcompat

so if you have it located in C:\\Program Files\\adt-bundle-windows-x86-20131030\\sdk\\extras\\android\\support\\v7\\appcompat, then you have to move your own project somewhere on drive C:\\ (eg C:\\Users\\User\\workspace) 所以,如果你有它位于C:\\ Program Files \\ adt-bundle-windows-x86-20131030 \\ sdk \\ extras \\ android \\ support \\ v7 \\ appcompat,那么你必须在驱动器C:\\上的某个地方移动你自己的项目(例如C:\\ Users \\ User \\ workspace)

this work for me 这项工作对我来说

Do as below: 请执行以下操作:

Go to File --> Import -->Import the library project into your workspace(select the project exists here C:\\Program Files\\adt-bundle-windows-x86-20131030\\sdk\\extras\\android\\support\\v7\\appcompat ). 转到文件 - > Import - >将库项目导入工作区(选择项目存在于此处C:\\Program Files\\adt-bundle-windows-x86-20131030\\sdk\\extras\\android\\support\\v7\\appcompat )。

Then Right Click on your project-->Select Android --> Add -->Select the library project you have imported. 然后右键单击您的项目 - >选择Android - > Add - >选择您导入的库项目。

don't forget to checkmark the library project in Project-->Right Click--> Properties --> Java Build Path --->Order and Export 不要忘记在项目 - >右键单击 - > Properties - > Java Build Path --->订单和导出中勾选库项目

  • Remove all of your library projects 删除所有库项目
  • Do a clean of the project with the dependecies 与家属一起清理项目
  • Add the problematic library again 再次添加有问题的库
  • Add all of the other libraries 添加所有其他库

you need to import the library into your workspace first then right click on the project you want to add it to and click properties and under android click add in the libraries section. 首先需要将库导入工作区,然后右键单击要添加到其中的项目,然后单击属性并在android下单击“添加”库部分。 select the imported library. 选择导入的库。 dont import using build path 不要使用构建路径导入

Select "Java Build Path" and tab Libraries instead of "Android". 选择“Java Build Path”并选择Libraries而不是“Android”。 Click "Add external Jars..." 点击“添加外部JAR ......”

or 要么

Copy the file to your "libs" folder and right click on the file and select "Build Path" -> "Add to Build Path" 将文件复制到“libs”文件夹并右键单击该文件并选择“Build Path” - >“Add to Build Path”

将eclipse_workspace文件夹的路径更改为与Android SDK相同的驱动程序解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM