Thursday, September 4, 2014

Missing Android Private Libraries in Build Path

I recently came across the following error while creating a new android application project in eclipse.
My project has dependencies to appcompat_v7 project.


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.
Versions found are:
Path: D:\rohit\eclipse_workspace\AndroidNotificationProgress\libs\android-support-v4.jar
Length: 758727
SHA-1: efec67655f6db90757faa37201efcee2a9ec3507
Path: D:\rohit\eclipse_workspace\appcompat_v7\libs\android-support-v4.jar
Length: 648327
SHA-1: ded9acc6a9792b8f1afc470f0c9cd36d178914cd
Jar mismatch! Fix your dependencies

Fortunately i found the solution. If you have recently updated your android SDK then that could be the cause of this error.

If you also got this type of error, then follow below steps to fix it.

First of all, if you have any android-support-xx.jar file in your project’s libs directory then delete it.

1) Check your Project Properties → Java Build Path. It will have Android Private Libraries missing as shown in below screenshot.

missing private libraries.png

2) Go to Project Properties → Android . Copy the SDK path configured in this as below.

android sdk path.png

3) Go to the directory : <android-sdk-home>\extras\android\support\v7\appcompat\libs You will find below 2 files there. android-support-v4.jar android-support-v7-appcompat.jar Copy these 2 files. and paste it to your appcompat_v7 project’s lib directory in your workspace. <your-workspace-dir>\appcompat_v7\libs 4) Clean and build both the project. appcompat_v7 and the one on which you got the error.

1 comment:

Creating and Deploying Java Web Application on AWS using Elastic Beanstalk

This tutorial is for creating simple java web application using eclipse and then deploying it on AWS cloud. Video tutorial for creating/de...