0

I have a MapFragment that I dynamically display in my Activity.

But It says that I have to update Google Play Services. I've done this by updating the Dependencies, but it doesn't work.

Any ideas?

Heres my Gradle file:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:support-v4:25.1.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services:10.2.0'

}

My Fragment:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ibas.locatix_teamviewer.mapFragment">

<com.google.android.gms.maps.MapView
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:layout_marginTop="12dp"
    android:id="@+id/mapView"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" />

And here is my Activity: enter image description here

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
skm
  • 559
  • 1
  • 6
  • 22

1 Answers1

0

The google play-services version on your device is out of date. Just click the update-button, and you will be able to download the newest version on your device from the play-store.

Edit: There are similar questions like this on Stackoverflow. You might find these questions and answers useful.

According to the documentation your emulator should also use Android 4.2.2 or above.

To test your app when using the Google Play services SDK, you must use either:

  • A compatible Android device that runs Android 4.0 or higher and includes Google Play Store.

-The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.

Community
  • 1
  • 1
Rockney
  • 10,380
  • 2
  • 20
  • 26
  • When i click "update" the application crashes... What to do? – skm Mar 14 '17 at 07:54
  • @skm which device have you got an which Android version? – Rockney Mar 14 '17 at 20:18
  • On my Own Device (Samsung s6) it works fine but in the Emulator (AVD) it just shows this information that the playservices have to be updated...when i click update it crashes. – skm Mar 15 '17 at 22:43