ActionBarSherlock android-support-v4 jar checksum difference - android

Can someone explain why the android-support-v4.jar included with ActionBarSherlock has a different size (and, therefore, checksum) then the one added automatically by Android when setting up a new project? Are their customizations to the support code included with ActionBarSherlock? If not, is it safe to replace this jar with android-support-v13.jar since it already includes all of the code in android-support-v4.jar?

Remove the default android-support-v4.jar from android project and copy that jar from ActionBarSherlock library project. or vice verse. It is safe.
That will resolve the confict.
Reason
It would be the reason that our sdk copies the newer version of that jar into new project but ActionBarSherlock would have the older version of the same.

The android-support-v4.jar included in ActionBarSherlock is 5 months old. Since then Google has released several new versions of the support library. Since the two versions differ their checksums won't match.
It is safe to replace the version included in ABS with the version you're using in your main project.

This is a more elegant fix than deleting and adding files!
You just need to :
Right Click the project App Free
Go To "Android Tools" > "Add Support Library"
Approve the permissions and let it update the library
Repeat this process for the project App Library
The Android Support Library will then be in sync (:

Related

appcompat_v7 vs \v7\appcompat library project

When I once built some simple project, Eclipse automatically generated appcompat_v7 library project in my workspace and include it in dependency list for my original project. Meanwhile, I downloaded new support library (via SDK manager) few times. Then I tried to built again the same project, but this time in dependency section, I manually removed appcompat_v7 and added project generated by successful built of Android-SDK\extras\android\support\v7\appcompat library project. This time I faced few build errors in original project, most of them being unable to find resources that match name "TextAppearance.AppCompat. ..." as parent style of some style tag in res\values\styles.xml (of original project). What am I missing ?
Eclipse handles appcompat with many problems. You always must:
Have a copy of appcompat library loaded into your workspace to import it in your project as library
Use the same support library version in your project and in the appcompat library. If you update the support library, update it manually in the appcompat and your project. Right button click over appcompat/project, Android Tools -> Add Support Library.
If you have style compile problems with appcompat library, use compileSdkVersion = 23, targetSdkVersion = 22
Finally, I will recommend to migrate to Android Studio too, much easier and much cleaner.
Later, I made a copy of Android-SDK\extras\android\support\v7\appcompat library project into my workspace (check box when making "new Android project form existing code") and original project compiles well. I considered as better practice not to copy appcompat, but rather to work through reference to it. That way I would have valid link to new version, when I upgrade support library over time. However it appeared as better move to make a copy.

Where did an additional `android-support-v7-appcompat` project come from in my workspace? Which one to use?

I have the latest Android Support library with Rev 22.2.1. I included the AppCompat v7 library from my SDK it in my workspace by following the guideline at the Android developer guides. Initially it included the project named appcompat_v7 in my project explorer. So far so good.
Then after creating a few projects and including a few other libraries like recyclerview and cardview and some third party library projects, I now notice two projects named appcompat_v7 and android-support-v7-appcompat in my project explorer.
This wouldn't bother me but now whenever I want to add the appcompat v7 library in my project, I am given both the options, and I get confused about which one to use. So the question is that where did android-support-v7-appcompat come from, and which one should I use when I want to include the v7 library in a project (also provided that the project is also using another third party library project).
Select Second Option AppCompat_v7
AppCompat_v7 is actually Android Support library which is introduced recently and is required for Application Compatibility for older versions of Android.
Please select second library (AppCompat_v7) as mentioned in above comment.
You can also read below articles if you need more info:
https://developer.android.com/tools/support-library/index.html
https://developer.android.com/tools/support-library/features.html

including support library in project

When i create a new Android project with min sdk as 2.2 in Eclipse , the support libraries are automatically added to Android Private Libraries, Android Dependencies and libs. That's probably because I had setup a support library project(appcompat_v7) earlier as per https://developer.android.com/tools/support-library/setup.html.
So my question is there a better way to include the support libraries in a project rather than have it appear all over the place? Is this the expected way?
Latest ADT automatically creates a new Android library project called appcompat_v7 in your workspace. This library project contains all the jar-files needed for supporting older Android version.
When you create a new Android application project, it will automatically receives a new dependency on that library project. It looks there is a small bug in ADT causing android-support-v4.jar to be added twice. You can safely remove android-support-v4.jar from the libs folder, as this jar-file is already available in appcompat_v7.
The best practice would be to keep a dependency on appcompat_v7 and delete duplicated android-support-v4.jar file.

Adding multiple libraries on Android

I want to add multiples libraries on Android, but every one of them have the support library v4, and need them. I want to add : android-support-v7-appcompact, facebookSDK, PullToRefresh, google-play-services_lib.
I have DEX errors and NoClassDef errors every time.
For each project right click > Android Tools > Add Support Library
Although the support library is already added to the project it will download and install the latest version of the support library.
If you do this for each library project you should no longer see the error.
Hope this helps.
If the support library versions are not same there'll be error.
Either copy one of the support library v4 to all of them or delete all of the support libraries and just leave one of them

Jar mismatch! action bar sherlock and facebook sdk

im writing an app that uses action bar sherlock and facebook sdk.
Therefore i imported those two libraries into my project and i get and error
saying i have two jars of android-support-v4.jar
"Found 2 versions of android-support-v4.jar in the dependency list
but not all the versions are identical (check is based on SHA-1 only at this time).
All versions of the libraries must be the same at this time."
what can i do? can i put one of the jars into the other library?
they supposed to identical, but their sizes are diff..i dont wana go and change/delete libraries in the sourcode.
any ideas?
Jar mismatch problem is happened because there are 2 versions of android-support-v4.jar in the dependency list one of them is included in Facebook SDK library and the other in ActionBarSherlock library.
The fix to this problem is to delete the android-support-v4.jar from one of these two library and copy the other android-support-v4.jar instead of the deleted one, in this way you will be sure you have the same version of the jar file in both libraries and you will get ride of the build error.
adding one as a jar and the other as a library. still i have two diff android-support-v4.jar's but it seems the compiler can live with it. so every library as it seems uses its own android-support-v4.jar.

Categories

Resources