Reputation: 3
I am using Android Studio, and I want to use Firebase Analytics and Firebase Ads (AdMob). I followed all the available documentation and added the following in my app level gradle file, in the dependencies section:
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-ads:9.6.1'
However, I noticed that under the Project's "External Libraries" there was a ton of Firebase libraries that I don't want to use (see image).
I don't know how all these got into the project workspace, if they will be included in the build, and if I can just go ahead and delete them.
Any help appreciated.
Upvotes: 0
Views: 224
Reputation: 3
The unneeded Firebase libraries were actually coming from the Google Play Service dependency (compile 'com.google.android.gms:play-services:9.6.1').
I'm not very familiar with Android and all these libraries, so I couldn't see the relationship between the Google Play Service and Firebase libraries, and this why I hadn't mentioned it in my question.
Anyway, I removed it and all the unneeded Firebase libraries were removed from the project. Now I'll just add the specific Google Play Services API as needed for my app instead of the whole google play dependency.
Upvotes: 0
Reputation: 19960
You shouldn't have all of those for that set of dependencies, but you will have some extra.
You can run:
./gradlew app:dependencies
(assuming your module is called "app") to see a list of dependencies. For me this results in the below list.
+--- com.google.firebase:firebase-core:9.6.1
| \--- com.google.firebase:firebase-analytics:9.6.1
| +--- com.google.android.gms:play-services-basement:9.6.1
| | \--- com.android.support:support-v4:24.0.0 -> 24.2.1 (*)
| +--- com.google.firebase:firebase-common:9.6.1
| | +--- com.google.android.gms:play-services-basement:9.6.1 (*)
| | \--- com.google.android.gms:play-services-tasks:9.6.1
| | \--- com.google.android.gms:play-services-basement:9.6.1 (*)
| \--- com.google.firebase:firebase-analytics-impl:9.6.1
| +--- com.google.android.gms:play-services-basement:9.6.1 (*)
| +--- com.google.firebase:firebase-iid:9.6.1
| | +--- com.google.android.gms:play-services-basement:9.6.1 (*)
| | \--- com.google.firebase:firebase-common:9.6.1 (*)
| \--- com.google.firebase:firebase-common:9.6.1 (*)
\--- com.google.firebase:firebase-ads:9.6.1
+--- com.google.android.gms:play-services-ads:9.6.1
| +--- com.google.android.gms:play-services-ads-lite:9.6.1
| | \--- com.google.android.gms:play-services-basement:9.6.1 (*)
| +--- com.google.android.gms:play-services-base:9.6.1
| | +--- com.google.android.gms:play-services-basement:9.6.1 (*)
| | \--- com.google.android.gms:play-services-tasks:9.6.1 (*)
| +--- com.google.android.gms:play-services-clearcut:9.6.1
| | +--- com.google.android.gms:play-services-base:9.6.1 (*)
| | \--- com.google.android.gms:play-services-basement:9.6.1 (*)
| +--- com.google.android.gms:play-services-basement:9.6.1 (*)
| \--- com.google.android.gms:play-services-gass:9.6.1
| \--- com.google.android.gms:play-services-basement:9.6.1 (*)
\--- com.google.firebase:firebase-analytics:9.6.1 (*)
All of the libraries here are as expected - its a mix of the common code for various parts of Firebase, the Analytics library from core and the play-services-ads
library.
Make sure you've done a clean build since changing your Gradle file, and check for any thing which may depend on other com.google.firebase libraries (such as FirebaseUI).
Upvotes: 1