简体   繁体   中英

Android: Replace android-support-v4.jar with ActionBarSherlock in Eclipse project

I'm using the Eclipse ADT bundle v21. I'm trying to do what is described here . When I create a new Android project it will automatically add android-support-v4.jar to the dependencies and in the /libs folder of the project.

When I now make ActionBarSherlock a dependency (add o the library list of Project>Properties>Android ), Eclipse says:

Jar mismatch! Fix your dependencies

because ABS has the same jar.
I managed once to just delete android-support-v4.jar from the /libs folder and everything went fine, but with every new project I create it doesnt work, Eclipse won't let me delete that jar:

An exception has been caught while processing the refactoring 'Delete'.
Reason: Problems encountered while deleting resources.

I havent been doing anything differently when creating the one project where the deletion of the jar from /libs worked fine. Is there some workaround or am I doing something completely wrong?

  • delete the support library jar from your project.
  • delete the support lib in ABS project.
  • add latest support lib to ABS project by right click -> android tools -> add support library
  • link ABS project to your project.

Now your project uses the latest support jar from ABS project, so no need to add it to any other projects that depend on ABS project.

probably you have different versions of support library in main project and actionbarsherlock. Copy support library from libs folder to actionbarsherlock/libs folder.

And if first step of Doctoror Drive's advice is not working for you, try re-run eclipse with administrator permissions. Took me like half an hour to get around this, so I'd like to share.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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