简体   繁体   English

Android依赖性配置

[英]Android dependancies configuration

I am going through the Android app tutorial here: 我在这里浏览Android应用程序教程:

http://developer.android.com/training/basics/actionbar/styling.html http://developer.android.com/training/basics/actionbar/styling.html

As part of what I am doing I added in the appcompat library as part of adding in the themes. 作为我正在做的事情的一部分,我在appcompat库中添加了作为添加主题的一部分。 Not sure how I got to this point but when I try to run the app I get the error : 不确定我是如何达到这一点但当我尝试运行应用程序时,我收到错误:

"The container 'Android Dependencies' references non existing library 'D:\\eclipse-bundle\\sdk\\extras\\android\\support\\v7\\appcompat\\bin\\android-support-v7-appcompat.jar'" “容器'Android Dependencies'引用非现有库'D:\\eclipse-bundle\\sdk\\extras\\android\\support\\v7\\appcompat\\bin\\android-support-v7-appcompat.jar'"

The library DOES exist, just not at this location. 图书馆存在,而不是在这个位置。 It is located at: 它位于:

D:\\eclipse-bundle\\sdk\\extras\\android\\support\\v7\\appcompat\\libs\\android-support-v7-appcompat.jar

There does not appear to be any way to edit this property. 似乎没有任何方法可以编辑此属性。 How do you fix this problem? 你是如何解决这个问题的? what is causing it? 是什么造成的?

Thanks in advance for any help. 在此先感谢您的帮助。

Make sure you follow this step to add .jar files. 请确保按照此步骤添加.jar文件。

In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path . 在新库项目中, 展开libs /文件夹,右键单击每个.jar文件,然后选择“构建路径”>“添加到构建路径” For example, when creating the the v7 appcompat project, add both the android-support-v4.jar and android-support-v7-appcompat.jar files to the build path. 例如,在创建v7 appcompat项目时,将android-support-v4.jar和android-support-v7-appcompat.jar文件添加到构建路径。

I had the same issue so I CMD+Q'd Eclipse and re-opened it.... magically worked. 我有同样的问题,所以我CMD + Q'd Eclipse并重新打开它....神奇地工作。 I guess "turning it off an on again" works sometimes :D 我想“再次打开它”有时会起作用:D

You can select your project on eclipse, then right-click... 您可以在eclipse上选择项目,然后右键单击......

A menu should appear, you can click on "properties". 应该出现一个菜单,您可以单击“属性”。

A flying screen should appear, you can click on "Java Build Path" 应该出现一个飞行屏幕,你可以点击“Java Build Path”

Another flying screen should appear, you can click on the tab "Libraries" 应该出现另一个飞行屏幕,您可以单击“库”选项卡

This tab actually hold references to what is in the "libs" folder, and you can delete your old lib and insert your new lib (with the correct path) there. 该选项卡实际上包含对“libs”文件夹中的内容的引用,您可以删除旧的lib并在那里插入新的lib(使用正确的路径)。


Would not recommend any of it, actually... Please just import the "support lib project" into your eclipse workspace and make your project reference the imported project as a "lib project". 不推荐任何一个,实际上......请将“支持lib项目”导入您的eclipse工作区,并使您的项目将导入的项目作为“lib项目”引用。

That is way more handy, and will actually give you a better flexibility for doing more stuff with compatibility lib. 这样更方便,并且实际上会为您提供更好的灵活性,以便使用兼容性lib来执行更多操作。

And also, since it is on your workspace, you are the one that compiles it. 而且,由于它位于您的工作区,您就是编译它的人。 No future lib reference problems \\o/ 没有未来的lib引用问题\\ o /

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

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