ANSWERED: Delete support library inside of libs inside of class.
I have been struggling to get ActionBarSherlock library working in my Android App where I have a Google Map fragment.
My app was fully functional showing maps and once I (for the first time) successfully imported the actionbarsherlock library(that is in the list of projects open in package explorer) all lines of codes related to google maps is causing an error : the import of com.google.android.gms can not be resolved.
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
public class MainActivity extends SherlockFragmentActivity {
private GoogleMap googleMap = null;
SupportMapFragment mMapFragment;
I have tried to re-import google play services_lib (which is ALSO on the left side in package explorer) and nothing has changed. I tried restarting eclipse but that did not help. I suppose the first step is to check if google play services lib is in my project but I do not know how to do that.
Is there some kind of issue of having both of these(maps and actionbarsherlock?).
UPDATE: this began happening IMMEDIATELY after the errors went away from actionbarsherlock. Also as written below: under Android dependencies, both jar files are there, (google-play-services_lib.jar and actionbarsherlock.jar). Also, yes google play services is referenced there
I just tried going back to simply FragmentActivity and switching imports from import com.actionbarsherlock.app.SherlockFragmentActivity; to import android.support.v4.app.FragmentActivity; and it continues to say that it can't be resolved
UPDATE2: When I have the code as
public class MainActivity extends FragmentActivity {
(with the correct import) it says that FragmentActivity can not be resolved to a type, but when it is
public class MainActivity extends SherlockFragmentActivity {
it says that the hierarchy of MainActivity is inconsistent
UPDATE 3:
Found 2 versions of android-support-v4.jar in the dependency list,
[2013-07-08 13:40:04 - Maps] but not all the versions are identical (check is based on SHA-1 only at this time).
[2013-07-08 13:40:04 - Maps] All versions of the libraries must be the same at this time.
[2013-07-08 13:40:04 - Maps] Versions found are:
[2013-07-08 13:40:04 - Maps] Path: D:\Workspace\google-play-services_lib\libs\android-support-v4.jar
[2013-07-08 13:40:04 - Maps] Length: 484258
[2013-07-08 13:40:04 - Maps] SHA-1: bd6479f5dd592790607e0504e66e0f31c2b4d308
[2013-07-08 13:40:04 - Maps] Path: D:\Workspace\actionbarsherlock2\JakeWharton-ActionBarSherlock-071a61c\actionbarsherlock\libs\android-support-v4.jar
[2013-07-08 13:40:04 - Maps] Length: 271754
[2013-07-08 13:40:04 - Maps] SHA-1: 53307dc2bd2b69fd5533458ee11885f55807de4b
[2013-07-08 13:40:04 - Maps] Jar mismatch! Fix your dependencies
Please check that you have referenced ABS in your project and that you have the ABS version of the v4 support lib (this is in the ABS libs folder) in your project (a more recent version of the V4 support lib is also acceptable).
Note that after adding the ABS version of the support library into your project you may then see errors like this on your logcat:
jar mismatch ...SHA1 check ...
This means that you are trying to use different versions of the V4 support libraries. Once you have the ABS version in your project you can delete any other versions of the support library from your referenced projects.