无法将 android.support.v7 添加到我的项目构建路径
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20523026/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cannot add android.support.v7 to my project build path
提问by irmdaen
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". I choose "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. And it has a beautiful green check markon the left!
这就是我所做的:右键单击我自己的项目-> 构建路径-> 配置构建路径-> 在左栏中选择Android,然后单击“添加”。我选择“android-support-v7-appcompat”。这个名字出现在表的右列,左边是库所在的路径:C:\Program Files\adt-bundle-windows-x86-20131030\sdk\extras\android\support\v7\应用兼容。它的左侧有一个漂亮的绿色复选标记!
I click Apply or Ok.
我单击应用或确定。
Then I go to this screen again, but though the path is still on the left in the table, there is a red crosson the left and a question mark, where "android-support-v7-appcompat" should have been. I have done exactly what is described in http://developer.android.com/tools/support-library/setup.html(title "Adding libraries with resources").
然后我再次进入这个屏幕,虽然路径仍然在表格的左边,但左边有一个红叉和一个问号,“android-support-v7-appcompat”应该在哪里。我已经完成了http://developer.android.com/tools/support-library/setup.html(标题“添加资源库”)中描述的内容。
Has someone any idea????
有人有什么想法吗????
回答by usnul
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:\ (e.g. 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
这对我有用
回答by TNR
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
不要忘记在 Project-->Right Click--> Properties
--> Java Build Path
--->Order and Export 中勾选库项目
回答by Dieguinho
- 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
- 删除所有库项目
- 使用依赖项清理项目
- 再次添加有问题的库
- 添加所有其他库
回答by nmi
Changing the path of eclipse_workspace folder to the same driver as the Android SDK solved my problem.
将 eclipse_workspace 文件夹的路径更改为与 Android SDK 相同的驱动程序解决了我的问题。
回答by tyczj
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. select the imported library. dont import using build path
您需要先将库导入您的工作区,然后右键单击要添加到的项目并单击属性,然后在 android 下单击库部分中的添加。选择导入的库。不要使用构建路径导入
回答by stefana
Select "Java Build Path" and tab Libraries instead of "Android". Click "Add external Jars..."
选择“Java 构建路径”并选择“库”而不是“Android”。单击“添加外部罐子...”
or
或者
Copy the file to your "libs" folder and right click on the file and select "Build Path" -> "Add to Build Path"
将文件复制到“libs”文件夹并右键单击该文件并选择“构建路径”->“添加到构建路径”