com.google.android.gms:play-services-maps has reported version 16.0.0 as outdated – Android

by
Alexei Petrov
android braintree flutter google-play-services

Quick Fix: Navigate to Flutter project’s android directory and run "gradlew app:dependencies" to find the app using the outdated dependency. Update the dependency version or fix it manually by searching and updating the version in the android/build.gradle file.

The Problem:

A Flutter Ecommerce application is facing a warning from the Google Play Store stating that the developer of Maps SDK for Android (com.google.android.gms:play-services-maps) has reported version 16.0.0 as outdated. The Play Store will not allow publishing updates to the app after 90 days if this outdated version is not upgraded to a newer version (17.0.0+). The issue seems to be caused by the dependency on the flutter_braintree package, which uses the outdated version of play-services-maps.

The Solutions:

Solution 1: Fix the dependency manually.

To resolve the issue of the outdated `com.google.android.gms:play-services-maps` dependency, you can manually update it to a newer version.

  1. Locate the dependency:
    Navigate to the Flutter app’s android directory and run the command gradlew app:dependencies. This will generate a dependency tree, where you can identify the package that’s using the dependency.

  2. Identify the package using the dependency:
    In the dependency tree, find the package that has com.google.android.gms:play-services-maps as a dependency. This package is typically a third-party library or plugin that you’ve integrated into your Flutter app.

  3. Update the package version:
    If there’s a newer version available for the package, update it. In the package’s android/build.gradle file, locate the dependencies section and change the version of com.google.android.gms:play-services-maps to a higher version.

  4. Rebuild the app:
    Once you’ve updated the dependency, rebuild the app by running flutter build apk or flutter build appbundle in the terminal.

  5. Test and update:
    Test the updated app thoroughly to ensure that it’s working correctly. If everything works as expected, you can proceed to update the app on the Play Store.

Q&A

Where to find the dependency causing the error message?

Go to FlutterAPP/Android directory.

How to find which app uses a dependency?

Run gradlew app:dependencies in the Android directory.

How to manually fix an outdated dependency?

Go to the Flutter Pub folder and find the dependency’s build.gradle file. Update the version in the dependency and rebuild the app.

Video Explanation:

The following video, titled "Failed to resolve com.google.android.gms:play services maps:11 ...", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

How to fixing android studio error when trying to update build.gradle (google play service for map) see this video for details.