将 Actionbarsherlock 导入 Eclipse

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14208356/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:45:55  来源:igfitidea点击:

Importing Actionbarsherlock into eclipse

androideclipseimportactionbarsherlock

提问by Sai Valluri

Can someone tell me the steps on how to import the SherlockFragmentActivity.java and ActionBarSherlock folder correctly? I am not exactly sure how to do it and am getting many errors when trying.

有人能告诉我如何正确导入 SherlockFragmentActivity.java 和 ActionBarSherlock 文件夹的步骤吗?我不太确定该怎么做,并且在尝试时遇到很多错误。

回答by AlexGo

  1. Extract ActionBarSherlock project.
  2. Add the project in Eclipse like an android 4.0+ project.
  3. Then open you working project preferences and in Android section include de ActionBarSherlock project as library.
  4. Use what you need from ActionBarSherlock project.
  1. 提取 ActionBarSherlock 项目。
  2. 像 android 4.0+ 项目一样在 Eclipse 中添加项目。
  3. 然后打开您的工作项目首选项,并在 Android 部分包含 de ActionBarSherlock 项目作为库。
  4. 使用您需要的 ActionBarSherlock 项目。

You have a little tutorial on this site: tutorial

你在这个网站上有一个小教程:教程

回答by kwonye

  • Extract ActionBarSherlock
  • Open Eclipse and select File > Import
  • From there, select the library folder within the extracted ActionBarSherlock folder
  • Check "Copy projects into workspace"
  • Right click on the new project that should be named "library" go to Android Tools > Add Support Library
  • Follow those steps and you should be all set!
  • 提取 ActionBarSherlock
  • 打开 Eclipse 并选择文件 > 导入
  • 从那里,选择提取的 ActionBarSherlock 文件夹中的库文件夹
  • 勾选“将项目复制到工作区”
  • 右键单击应命名为“library”的新项目,转到 Android 工具 > 添加支持库
  • 按照这些步骤,你应该一切准备就绪!

One thing you should pay attention to is the console. You might get permission issues if your Android SDK is installed in Program Files (x86). What you would need to do is then make sure you change the permissions so that apps can alter that folder. I know I had that problem and it took me forever to find because I didn't pay attention to the console.

您应该注意的一件事是控制台。如果您的 Android SDK 安装在 Program Files (x86) 中,您可能会遇到权限问题。您需要做的是确保更改权限,以便应用程序可以更改该文件夹。我知道我有这个问题,我花了很长时间才找到,因为我没有注意控制台。

回答by tpbapp

You get errors because you already have android-support-v4.jarin the /libs/directory of your project, but the ActionBarSherlockproject already includes this library and so a conflict occurs.

你得到的错误,因为你已经android-support-v4.jar/libs/你的项目目录,但该ActionBarSherlock项目已经包含了这个库,因此发生冲突。

To fix this delete android-support-v4.jarfrom your project then go to Project > Clean.

要从android-support-v4.jar您的项目中修复此删除,请转到Project > Clean.

回答by Kaveesh Kanwal

Follow the steps below and i am 100% sure that you will be successful in importing the android Action Bar Sherlock library.

按照以下步骤操作,我 100% 确定您将成功导入 android Action Bar Sherlock 库。

  1. The first thing you have to do, is to download the library from http://actionbarsherlock.com? . After this unzip/untar it.

  2. The folder that you get will contain a number of sub-folders and files. Your action bar sherlock library is in the folder “actionbarsherlock”. Now, rename the folder “actionbarsherlock” to “ActionBarSherlockLib”.

  3. Now go to Eclipse and add the ABS(Action Bar Sherlock )-library as an Android project. Do not use Eclipse's import toolto import the ActionBarSherlock library – it would not work immediately and you would have to fix some settings. Instead, create a new project as explained in the next step.

  4. Open File -> New -> Project -> Android Project From Existing Code. Select this and click next.

  5. In the next screen eclipse will ask you to browse the root directory. You have to select the root folder which contains all the files and folders that you had initially unzipped. After selecting the correct root folder, eclipse suggests a list of projects to create.

  6. You have to only check “ActionBarSherlockLib” and uncheck the rest.

  7. Check 'copy projects into workspace' and click finish.

  8. You are now a champion and have successfully imported the action bar sherlock library into eclipse. Congrats.

  1. 您必须做的第一件事是从http://actionbarsherlock.com下载库?. 在此之后解压缩/解压它。

  2. 您获得的文件夹将包含许多子文件夹和文件。您的操作栏 Sherlock 库位于“actionbarsherlock”文件夹中。现在,将文件夹“actionbarsherlock”重命名为“ActionBarSherlockLib”。

  3. 现在转到 Eclipse 并添加 ABS(Action Bar Sherlock)库作为 Android 项目。不要使用 Eclipse 的导入工具来导入 ActionBarSherlock 库——它不会立即起作用,您必须修复一些设置。相反,按照下一步中的说明创建一个新项目。

  4. 打开文件 -> 新建 -> 项目 -> 来自现有代码的 Android 项目。选择此项并单击下一步。

  5. 在下一个屏幕中,eclipse 将要求您浏览根目录。您必须选择包含您最初解压缩的所有文件和文件夹的根文件夹。选择正确的根文件夹后,eclipse 会建议要创建的项目列表。

  6. 您只需选中“ActionBarSherlockLib”并取消选中其余部分。

  7. 选中“将项目复制到工作区”并单击完成。

  8. 您现在是冠军并且已成功将操作栏 Sherlock 库导入到 eclipse 中。恭喜。