​Google play services are needed - Firebase

2 posts, 0 answers
  1. Dimitar
    Dimitar avatar
    45 posts
    Member since:
    May 2014

    Posted 06 Sep Link to this post

    Hello , 

    I am receiving this message "Google play services are needed for this service but not availabe on this device "

    I suppose its' requred by Firebase nativescript plugin . But in general is it possible to add  this Google play services to my project .

    I am not sure what is happening , because from other point it seems its added to firebase include.gradle . From what I read it seems that user should have 

    Google Play services APK on their device .  (https://developers.google.com/android/guides/setup) 

    dependencies {

        // make sure you have these versions by updating your local Android SDK's (Android Support repo and Google repo)
        compile "com.google.firebase:firebase-core:11.0.+"
        compile "com.google.firebase:firebase-database:11.0.+"
        compile "com.google.firebase:firebase-auth:11.0.+"

        // for converting Java objects to JS
        compile "com.google.code.gson:gson:2.8.+"

        // for reading google-services.json and configuration
        def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : '11.0.+'
        compile "com.google.android.gms:play-services-base:$googlePlayServicesVersion"

     

  2. Nikolay Iliev
    Admin
    Nikolay Iliev avatar
    294 posts

    Posted 07 Sep Link to this post

    Hello Dimitar,

    The error you are receiving is not related to missing dependencies in your project, but to missing libraries on the device, you are testing. Most of the AVDs (Android Virtual Devices a.k.a. emulators) are coming without Google Play Services installed. If you want to test project that requires installed Google Play Services, you would either need a real device (with Google Play installed and enabled) or an emulator with installed Google Play Services. 

    When creating new AVD (Android emulator) make sure that the downloaded system image comes with Google APIs - full tutorial on how to create Android emulator can be found here. Notice that in the article the installed emulators are downloading system-images with Google APIs option (in brackets to the right).

    I hope this will solve your issue -please do let me know if you need further assistance on that matter or if the provided info is not resolving your case.

    Regards,
    Nikolay Iliev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Back to Top