the doc clearly says that
"
Add a <fragment> element to your activity's layout file, activity_maps.xml. "
so the the "activity_maps.xml" is the activity layout file and the following code should be inside the "activity_maps.xml"
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.currentplacedetailsonmap.MapsActivityCurrentPlace" />
refer the this link if you find it helpful
https://stackoverflow.com/questions/20314635/android-map-in-fragment