Issue
I am using Android Studio 3.3 canary 13
. The app is crashing with this message.
I am getting this error :
Caused by: android.view.InflateException: Binary XML file line #274: Binary XML file line #274: Error inflating class com.google.android.gms.maps.MapView
Caused by: android.view.InflateException: Binary XML file line #274: Error inflating class com.google.android.gms.maps.MapView
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.MapView" on path: DexPathList[[zip file .
Can anyone help on how to use MapView
in AndroiX
?
Problematic XML line:
<com.google.android.gms.maps.MapView
android:id="@+id/map_view"
android:layout_width="0dp"
android:layout_height="140dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_address"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0"
android:layout_marginTop="16dp"
/>
Solution
May be this work, just define in your AndroidManifast.xml
Add First:-
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyC6TVk6gtR_i_.......**************"/>
Then:-
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="@integer/your_google_maps_version" />
Answered By - Taufik Android
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.