简体   繁体   中英

Using ActionBarSherlock and the support library

I'm trying to add menus to my app, and for compatibility with older versions of android I decided to try ActionBarSherlock.

My app uses the support v4 library heavily, for example it uses ViewPager .

Now, when I added ActionBarSherlock I got the "jar mismatch" error. Fixed that by removing the support library jar from the build path. but then I get "cannot be resolved to a type" for all the things that use the support library. I got it that ABS exports a few classes such as SherlockFragmentsActivity but it doesn't have anything like SherlockViewPager .

How can I use the support library, or am I missing something here?

I don't know if there is other way to fix it, but just copy the v4 support library from ABS to your project (or the other way around) and add it to the build path. It should work and shouldn't get the "jar mismatch" error. This is the way I do it in my projects.

ABS is already using the android support library. If you are using it as well, make your project and ABS use the same version.

An easy way is to remove the support library from your project and add to the ABS library project.

That way the support library will be provided to your project at the same time as ABS

It looks like you have 2 versions of library.... one from the ABS and Second while you Added support library. Once try to delete android-support-V4.jar from your lib folder and rebuild the project.

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