My app is unfortunately stopped. I am getting this error in Logcat. : FATAL EXCEPTION: main
                                                                       Process: org.example.easyparking, PID: 6371
                                                                       java.lang.RuntimeException: Unable to start activity ComponentInfo{org.example.easyparking/org.example.easyparking.MapActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class fragment

This is my mapactivity

        package org.example.easyparking;
        import android.app.Dialog;
        import android.support.v7.app.AppCompatActivity;
        import android.os.Bundle;
        import android.widget.Toast;


        import com.google.android.gms.common.ConnectionResult;
        import com.google.android.gms.common.GoogleApiAvailability;
        import com.google.android.gms.maps.GoogleMap;
        import com.google.android.gms.maps.MapFragment;
        import com.google.android.gms.maps.OnMapReadyCallback;

        public class MapActivity extends AppCompatActivity implements 
        OnMapReadyCallback {

        GoogleMap mGoogleMap;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map);
        if(googleServicesAvailable()){

            setContentView(R.layout.activity_map);
            initMap();
        }else{
            //No Google Map Layout
        }
    }

    private void initMap() {
        MapFragment mapFragment = (MapFragment) getFragmentManager().
                findFragmentById(R.id.mapFragment);
        mapFragment.getMapAsync(this);
    }

    public boolean googleServicesAvailable(){
        GoogleApiAvailability api = GoogleApiAvailability.getInstance();
        int isAvailable = api.isGooglePlayServicesAvailable(this);
        if(isAvailable == ConnectionResult.SUCCESS){
            return true;
        }else if (api.isUserResolvableError(isAvailable)){
            Dialog dialog = api.getErrorDialog(this, isAvailable, 0);
            dialog.show();
        }else{
            Toast.makeText(this, "Can't connect", Toast.LENGTH_LONG)
                    .show();
        }
        return false;
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        mGoogleMap = googleMap;
    }
    }


This is menifest

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.example.easyparking">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    <permission android:name="org.example.easyparking.permission.MAP_RECEIVE"
        android:protectionLevel="signature"/>

    <uses-permission android:name="org.example.easyparking.permission.MAP_RECEIVE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permissions.READ_GSERVICES"/>

    <uses-feature android:glEsVersion="0x00020000"
        android:required="true"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".FirstActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".MapActivity" />

        <activity
            android:name=".SecondActivity">

        </activity>

        <meta-data android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyDGpV3ndPQ1Z4zf1nXi5AW1c7jGPL1La7Q"/>

        <meta-data android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"/>



    </application>
    </manifest>



This is the first activity
        

        package org.example.easyparking;
        import android.content.Intent;
        import android.support.v7.app.AppCompatActivity;
        import android.os.Bundle;
        import android.view.View;
        import android.widget.Button;
        import android.widget.Toast;

    public class FirstActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);
        Button button = (Button) this.findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Toast.makeText(getApplicationContext(),
                        "Make sure that your location is turned on",
                        Toast.LENGTH_LONG).show();

                Intent newacti = new Intent(FirstActivity.this, MapActivity.class);
                startActivity(newacti);
            }
        });

        Button button_parking_owner = (Button) this.findViewById(R.id.button2);
        button_parking_owner.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent newacti = new Intent(FirstActivity.this, SecondActivity.class);
                startActivity(newacti);
            }
        });
    }
    }

Please help me out. I am sucking here since a day.












