I am trying to set the Google Map in an Android Studio Project but facing incompatible types error even after applying different options couldn't get rid of it. Thanks for your time and guidance
Screenshot of error
Logcate report
Error:(454, 88) error: incompatible types: Fragment cannot be converted to SupportMapFragment
XML code
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map2"
class="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Activity code
public class Search extends FragmentActivity implements OnMapReadyCallback
private void initializeMap()
{
SupportMapFragment map = ((SupportMapFragment) getFragmentManager().findFragmentById(R.id.map2)).getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap googleMap) {
}