0
import android.support.v4.app.FragmentActivity;                                   
import android.os.Bundle;                                                         

import com.google.android.gms.maps.GoogleMap;                                     
import com.google.android.gms.maps.SupportMapFragment;                            
import com.google.android.gms.maps.model.LatLng;                                  
import com.google.android.gms.maps.model.MarkerOptions;      

I am getting cannot resolve symbol for for both support.v4 and google.android. I have tried everything as I have the google play services installed on the sdk; I am doing the code on android studio platform, I have also added the play services dependency to the project structure; and provided the API too; but still why am I getting the cannot resolve error?

Jeremy W
  • 1,889
  • 6
  • 29
  • 37
Neal
  • 11
  • 1

1 Answers1

1

Based from this documentation, the Support Package includes static "support libraries" that you can add to your Android application in order to use APIs that are either not available for older platform versions or that offer utility APIs that aren't a part of the framework APIs. The goal is to simplify your development by offering more APIs that you can bundle with your application so you can worry less about platform versions.

Try to fix your error using these steps from this link:

  1. Go to your Project's Properties
  2. Navigate to the Java Build Path
  3. Then go to the Libraries tab. There click the Add External JARs Button on the Right pane.
  4. Select the android-support-v4.jar file, usually the path for the Jar file is :
    YOUR_DRIVE\android-sdks\extras\android\support\v4\android-support-v4.jar
  5. After adding andorid-support-v4.jar Library, navigate to the Order and Export tab and put check mark on the android-support-v4 Library file.
  6. After doing the above, Clean the Project and Build it.

Hope this helps!

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59
  • 1
    Might be worth mentioning as an alternative [how to add the dependency to the app's gradle config](https://developer.android.com/topic/libraries/support-library/setup.html#add-library) too. – Cliabhach Jul 20 '16 at 16:16