This is a migrated thread and some comments may be shown as answers.

​Google play services are needed - Firebase

1 Answer 221 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dimitar
Top achievements
Rank 1
Dimitar asked on 06 Sep 2017, 02:05 PM

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"

 

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 07 Sep 2017, 03:17 PM
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.
Tags
General Discussion
Asked by
Dimitar
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Share this question
or