2016-06-21 6 views
0

Ich habe Push-Benachrichtigung und dafür werde ich Firebase verwenden. Ich habe auch eine Karte in meinem Projekt, für beide verwenden wir Google Play Services-Bibliothek. Da die Google Play Services-Bibliothek ist eine riesige. Ich möchte nur die spezifische Bibliothek für Map und Firebase. Kann mir jemand eine Antwort geben?Firebase und Maps, die alle Bibliotheken enthalten müssen?

+0

Hier ist ein Link mit allen '' 'google-play-services''' Bibliotheken. https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project – danypata

Antwort

1
// FOR GOOGLE MAPS 
// to use maps modules to your app 
compile 'com.google.android.gms:play-services-maps:8.3.0' 
// for more advanced features to add to your maps 
compile 'com.google.maps.android:android-maps-utils:0.4' 

Weitere detaillierte Schritte auf adding a map to an Android app

// FOR FIREBASE 
// to use the new firebase cloud messaging/notifications 
compile 'com.google.firebase:firebase-messaging:9.0.0' 
// for firebase analytics (recommended but optional) 
compile 'com.google.firebase:firebase-core:9.0.0' 

Weitere verfügbare Feuerbasis Bibliotheken, besuchen die documentation here

// ADD THIS AT THE BOTTOM 
apply plugin: 'com.google.gms.google-services' 

sicher sein zu update the IDE and Tools bevor die APIs

+0

apply plugin: 'com.google.gms.google-services', dieses plugin enthält auch alle map packages, warum brauchen wir separate abhängigkeiten wie compile 'com .google.android.gms: play-services-maps: 8.3.0 ' // für erweiterte Funktionen, die Sie Ihren Maps hinzufügen können kompilieren Sie' com.google.maps.android:android-maps-utils:4 'und auch Es wird empfohlen, nur Bibliotheken einzubeziehen, die alle benötigt werden, da sonst die Größe zunimmt und einige Probleme entstehen. Warum sollten wir dieses Plugin erneut einbinden? – neena

+0

Sie müssen dieses Plug-in hinzufügen, um die Abhängigkeiten für Basisbibliotheken hinzuzufügen, die für die von Ihnen aktivierten Dienste erforderlich sind. Lesen Sie die Dokumentation >> https://developers.google.com/android/guides/google-services-plugin – mgcaguioa