简体   繁体   English

将外部库导入Eclipse-Android

[英]Importing external library into eclipse - Android

I want to use the UnifiedPreference library in my app. 我想在我的应用程序中使用UnifiedPreference库。 I've imported the library into my workspace, then added the new project into my existing project by adding it as a library under Properties -> Android. 我已将库导入到工作区中,然后通过将其作为库添加到“属性”->“ Android”下,将新项目添加到现有项目中。 However I'm getting the following errors when I try to build my project which are coming from the UnifiedPreference project: 但是,当我尝试构建来自UnifiedPreference项目的项目时,出现以下错误:

Console: 安慰:

[2013-04-08 23:06:29 - unified-pref-library] ERROR: In <declare-styleable> PreferenceHeader, unable to find attribute icon
[2013-04-08 23:06:29 - unified-pref-library] ERROR: In <declare-styleable> PreferenceHeader, unable to find attribute title

The relevent logcat errors seem to be: relevent logcat错误似乎是:

PreferenceHeader_title cannot be resolved or is not a field UnifiedPreferenceHelper.java    /unified-pref-library/src/net/saik0/android/unifiedpreference   line 435    Java Problem
PreferenceHeader_title cannot be resolved or is not a field UnifiedPreferenceHelper.java    /unified-pref-library/src/net/saik0/android/unifiedpreference   line 299    Java Problem

Have I imported the library incorrectly? 我是否错误地导入了库? I've tried cleaning and building both projects without anything changing. 我尝试清理并构建两个项目,而没有做任何更改。

In Eclipse: 在Eclipse中:

  1. On the Package Explorer Package Explorer
  2. Right click in your Proyect > Properties 右键单击您的Proyect > Properties
  3. Select: Java Build Path 选择: Java Build Path
  4. Select and enable Android Dependencies 选择并启用Android Dependencies
  5. Put on the top in the list 放在列表顶部
  6. Click: OK 点击: OK

Figured it out, seems UnifiedPreference requires a dependency for ActionBarSherlock. 弄清楚了,似乎UnifiedPreference需要ActionBarSherlock的依赖项。 Thanks to tttony for putting me on the right track though. 不过,感谢tttony的帮助。

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

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