React-native-maps: "Having trouble with Google Play services. Please try again later" error

Created on 31 Mar 2019  路  48Comments  路  Source: react-native-maps/react-native-maps

Is this a bug report?

Yes

Have you read the Installation Instructions?

Yes

Environment

react-native: 0.59.2
react: 16.8.3
react-native-maps: "git+https://github.com/react-native-community/react-native-maps.git#c102c36d895cbef8b6a8deefd4c58fb0dc17638e"

Steps to Reproduce

react-native init
Use Android Oreo or Pie emulator
Load Mapview

Actual Behavior

The app displays the error message "having trouble with Google Play services. Please try again later"

It does work on my physical device, but both Android Oreo and Pie emulators does not work.

Reproducible Demo

https://github.com/Hyllesen/MapsProject
Screen Shot 2019-03-31 at 23 28 38

Most helpful comment

A colleague of mine experienced this error in his emulator. We noticed something in the logs that said this:

Google Play services out of date.  Requires 13400000 but found 13280022

We looked at his emulator's version, and it was running Google Play Services 13. When we upgraded the emulator's play services version to 16, that fixed the error.

All 48 comments

@Hyllesen your emulator should use an image with Google APIs.
Please check this and update the issue.

@rborn
My emulator is indeed with Google API's. What's even more odd, is that I am actually able to get react-native-maps working on the exact same emulator, but with a different project I started on some months ago with following versions:

"react": "16.6.3", "react-native": "0.57.8", "react-native-maps": "^0.22.1",

My working project is here: https://github.com/Hyllesen/TaxiApp/tree/03_ShowingDirections

I tried setting my failing project to same version as the earlier project, but it didn't help unfortunately.

I should maybe also note that I'm having issues with the following error:
react-native-maps:unspecified' --> 'com.android.support:support-annotations' strictly '25.2.0' because of the following reason: debugRuntimeClasspath uses version 25.2.0
Making my android build fail. But I found someone else had same issue and using the newer version from master branch seemed to fix it:

react-native-maps: "git+https://github.com/react-native-community/react-native-maps.git#c102c36d895cbef8b6a8deefd4c58fb0dc17638e"

Maybe the error is related to this:

ext { buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 supportLibVersion = "28.0.0" }

inside/android/build.gradle

The error with "is having trouble with Google Play services" is the same, even though I have removed these 2 lines:

    googlePlayServicesVersion = "11.8.0"
    androidMapsUtilsVersion = "0.5+"

It is still weird though, since this setting works in my earlier project on the same emulator:

  ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
        googlePlayServicesVersion = "11.8.0"
        androidMapsUtilsVersion = "0.5+"
    }

I've just confirmed that it is something related to the React Native version. If I do a react-native init --version 0.57.8, then I am able to add react-native-maps and see the map fine. This was the config I used, that was working:

"react": "16.6.3", "react-native": "0.57.8", "react-native-maps": "^0.23.0"

react-native: 0.59.2 did not work well for me unfortunately.

same issue with

[email protected]
[email protected]
[email protected] (github:react-native-community/react-native-maps#12614e13afa43ed42c809f65508409c1d024e165)

@DillionApple is your issue only on emulator as well or both physical and emulator?

@Hyllesen On both physical and emulator. wired... I also followed the instruction to run the examples on android, but get just the same issue.

Any update in this issue? I too face the same issue.

I think it's due to Google Play Services. I tried a newer version of android emulator (Android 8.1 API 27), and it works just fine. And I also tried another phone (nexus 6P, Android 6.0), it also works fine. But for the phones made in China (Huawei), even though the Google Play Services is installed and updated, the error still occurs.

I think it's due to Google Play Services. I tried a newer version of android emulator (Android 8.1 API 27), and it works just fine. And I also tried another phone (nexus 6P, Android 6.0), it also works fine. But for the phones made in China (Huawei), even though the Google Play Services is installed and updated, the error still occurs.

Unfortunately I'm getting the error on both my emulators - Android 9.0 API 28, and Android 8.1 API 27. Both have Google API of course.

Same problem here. This works:
"react": "16.8.3",
"react-native": "0.59.4",
"react-native-maps": "[email protected]:react-native-community/react-native-maps.git#9e172fc6fd98dd81fb6f219193000100e36cc8e6",

But if I change react-native-maps to 0.24.0 I get the "Having trouble" error.

Same problem here. This works:
"react": "16.8.3",
"react-native": "0.59.4",
"react-native-maps": "[email protected]:react-native-community/react-native-maps.git#9e172fc6fd98dd81fb6f219193000100e36cc8e6",

But if I change react-native-maps to 0.24.0 I get the "Having trouble" error.

Do we need permission to use that commit?

@mikeKane try with the last published version 0.24.2 - the commit you are talking about seems to be merged. Let me know.

I am having the same problem, react-native 0.59.4 and have tried the latest 0.24.2 version but that doesn't seem to fix it. What @ryharrin's said does seem to work.

@rborn Packagelock.json Shows

"react-native-maps": { "version": "0.24.2", "resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-0.24.2.tgz", "integrity": "sha512-1iNIDikp2dkCG+8DguaEviYZiMSYyvwqYT7pO2YTZvuFRDSc/P9jXMhTUnSh4wNDlEeQ47OJ09l0pwWVBZ7wxg==" }

react-native-cli: 2.0.1 react-native: 0.59.4

ext { buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 supportLibVersion = "28.0.0" googlePlayServicesVersion = "11.8.0" androidMapsUtilsVersion = "0.5+" }

Not sure what I could be doing wrong.

Works on iOS if that helps at all. (Google Maps)

Same issue. This worked fine a few weeks ago. I did a fresh "react-native init", installed modules, and now I get the "having trouble with Google Play services. Please try again later" error.

Same problem here. This works:
"react": "16.8.3",
"react-native": "0.59.4",
"react-native-maps": "[email protected]:react-native-community/react-native-maps.git#9e172fc6fd98dd81fb6f219193000100e36cc8e6",

But if I change react-native-maps to 0.24.0 I get the "Having trouble" error.

How would I install this specific version of react-native-maps? If I try e.g. "npm install --save [email protected]" or earlier, I get a "BUILD FAILED" with "Could not resolve android.arch.[various]".

A colleague of mine experienced this error in his emulator. We noticed something in the logs that said this:

Google Play services out of date.  Requires 13400000 but found 13280022

We looked at his emulator's version, and it was running Google Play Services 13. When we upgraded the emulator's play services version to 16, that fixed the error.

The above worked for me. Thanks!

same here. In my case, it's the example app included in the repo that fails. Like Hyllesen I also have another app working on the same emulator which uses the same version of react-native-maps (I declared it as a file: dependency in my package.json). The app that works uses react-native 0.57.3 (I didn't run react-native init again on that one, and at this point I'm afraid to 馃槃)

Update: I tried with a genymotion device, and it worked, so then I tried installing a new AVD with the play store icon (note: it's not the same as "Google APIs"! There should be a google play icon on the first screen in the "Play store" column), and it still didn't work. After updating the Play Services as described by Darkiman, it worked.

@mcgloneleviROOT Solution worked for me. On the right side of your android emulators click the three dots on the bottom of the sidebar to open the settings panel, then click the google play tab and click update.

@mcgloneleviROOT Worked for me as well, @cmaycumber gave a nice little walkthrough. Just wanted to add one more comment about it in case you're just scrolling through and might have missed it

@Hyllesen @DillionApple @rogerbright could you please check the @mcgloneleviROOT solution? https://github.com/react-native-community/react-native-maps/issues/2778#issuecomment-484923171

Updating the Google Play Service only does not work. I used a GMS installer for my Huawei phones to reinstall all required the Google xxx components, and it worked.

I have the same issue again and again !!!!!!!!

How to fix:

  1. Click to bottom dots in the emulator
    image

  2. Go to Goog Play Tab and click Update

image

My emulator's "Extended Controls" panel does not have a Google Play tab. I will set up a different emulator and check.

@tomtom94 check this: #2823 (comment)

doesn't change anything, still not working.

I can't update google play like you do check this

Capture d鈥檈虂cran 2019-04-24 a虁 21 07 08

@tomtom94
Your emulator does not have the play store at all. You need to create a new emulator that has the play store symbol next to it's name in the Android studio menu

@tomtom94
Your emulator does not have the play store at all. You need to create a new emulator that has the play store symbol next to it's name in the Android studio menu

Ok so this is what happens now

error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have

So I check with adb devices

adb devices
List of devices attached
emulator-5554   unauthorized

Do you know why it is unauthorized ???

@tomtom94 [https://stackoverflow.com/questions/46898322/emulator-5554-unauthorized-for-adb-devices]](https://stackoverflow.com/questions/46898322/emulator-5554-unauthorized-for-adb-devices%5D)

Thanks a lot for your help, I tried everything and I already tried your stackoverflow solution many times before !!

I have an error, can't update this Google Play Services it stays in Loading... forever

This is maybe why adb devices gives me an unauthorized device

There was an unknown error while opening Google Play services Page.

Capture d鈥檈虂cran 2019-04-25 a虁 13 17 29

@tomtom94 sadly I don't know what it could be :(

But I don't use the emulator, but Genymotion (there is a free version). IMHO it works better than the emulator, eats less resources and is faster.

Ok it works fine for me.

Just don't use the last Android version ;)

Capture d鈥檈虂cran 2019-04-26 a虁 11 18 48

How are you, rborn?
Thanks for developing awesome component.
Could you do ma a favor?
I'd like to show google map on my android Nox emulator and real device.
But I can't see any map for both.

My used packages:
"react": "16.8.3",
"react-native": "0.59.3",
"react-native-maps": "^0.24.2",

err

err2

I have followed your installation document correctly.
I have connected google service and using other apk from google play.
Please help me.
I am looking forward to hearing good new from you.
Thanks.

@Xumochuan

First screenshot - emulator - is missing the google-apis sdk. you need to use an AVD that has google-apis in it. Also please read this thread as it has possible fixes in it.

Second screenshot - seems to be device - when the google logo shows up but the tiles no then is always an API key problem. Please search on the issues how to get solved (as it can have multiple causes)

Hi, @rborn
Thanks for your kind reply.
I am using Android SDK 28 and Nox emulator.
And I have just bought Google API Key, so key is correct.

Sorry, could you please tell me how to use google-api AVD?
Hope your kind answer...
Thanks.

I made it work by activating the google store in SDK settings. The icon of google store should be shown.

I add playServicesVersion in root build.gradle(path: project/android/build.gradle), and it works in my emulator (Google APIs).

ext {
    // others

    // The following message will be displayed after installing [email protected]
    // AppName is having trouble with Google Play services. Please try again
    //
    // The solution is to change the playServicesVersion from the 16.1.0(default setting) to 16.0.0
    // ps. playServicesVersion="16.1.0" is set in react-native-maps(path: project/node-modules/react-native-maps/build.gradle)
    //
    // Reference:
    // https://stackoverflow.com/questions/54771375/app-is-having-trouble-with-google-play-services-please-try-again
    playServicesVersion="16.0.0"
}

I'll close the issue as it seems there are various replies with possible fixes. Please reopen if you still have it.

I add playServicesVersion in root build.gradle(path: project/android/build.gradle), and it works in my emulator (Google APIs).

ext {
    // others

    // The following message will be displayed after installing [email protected]
    // AppName is having trouble with Google Play services. Please try again
    //
    // The solution is to change the playServicesVersion from the 16.1.0(default setting) to 16.0.0
    // ps. playServicesVersion="16.1.0" is set in react-native-maps(path: project/node-modules/react-native-maps/build.gradle)
    //
    // Reference:
    // https://stackoverflow.com/questions/54771375/app-is-having-trouble-with-google-play-services-please-try-again
    playServicesVersion="16.0.0"
}

Thank you! Its help me)

I have added playServicesVersion="16.0.0" to the ext { }, i have also updated Google play services in emulator, I still don't see map in the emulator and real device, react-native version 0.59.2 (expoKit project), @rborn this issue should be opened!

@ryharrin What version of react-native-maps it was? How did you get access to that commit?

I had same error,

replaced this (in android/build.gradle):

        googlePlayServicesVersion = "16.+"

with this:

        googlePlayServicesVersion = "17.+"

I am using react native 0.61.5, and

    "react-native-maps": "0.26.1",

the error disappeared.

@ChrisEelmaa also need to enableMultiDex in defaultConfigs

I had the same issue, you need android emulator thats supports Google Play Store.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

radubatori picture radubatori  路  46Comments

speller picture speller  路  63Comments

kytwb picture kytwb  路  54Comments

rborn picture rborn  路  72Comments

Starl0rd77 picture Starl0rd77  路  67Comments