0

I've been following youtube tutorials to add google map to my android apps; Specifically this video Google Maps API Setup (part2) and this video Step by Step Google Maps Implementation in Android App.

In both videos above, they simply paste the copied Fragment code from the Documentation and paste it within the default constraint layout. But they don't get the same errors that I do.

Android studio keeps asking me to replace the fragment tag with fragmentContainerViewer.

I tried following both tutorials and looking through other similar questions here such as Replace the tag with FragmentContainerView But i don't understand what the solution is.

Here's the error messages: Replace the <fragment> tag with FragmentContainerView.

Here's my XML code:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".SelectLocationMapActivity">

    <fragment
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.SupportMapFragment" />

</androidx.constraintlayout.widget.ConstraintLayout>

Here's my dependencies & plugins:

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'com.google.firebase:firebase-auth:21.0.3'
    implementation 'com.google.firebase:firebase-database:20.0.4'
    implementation 'com.google.firebase:firebase-storage:20.0.1'
    implementation 'com.google.android.gms:play-services-maps:18.1.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

Any help at all is appreciated, thank you.

0 Answers0