Recently i upgraded my project to android studio 3
In my build.gradle , i have: compile "com.google.android.gms:play-services-maps:10.2.1"
So it must use gms 10.2.1 , but in "#integer/google_play_services_version" i have following:
<integer name="google_play_services_version">11910000</integer>
And in the project --> External libraries i can clearly see that it compiles gms version 11.8:
Why this happens?
Use ./gradlew dependencies to check the dependency tree.
You are simply using a library that has a dependency with 11.8.0 and gradle uses the newest version.
Related
I'm a bit new to the Gradle build system. My app already had some working integrations with Google Play Services, including the Ads library. I'm trying to add the Android Nearby service to my build.gradle, but the import for the ads library no longer works specifically after I added in the Nearby library.
In my build.gradle:
dependency {
implementation "com.google.android.gms:play-services-nearby:$rootProject.ext.playServicesLibraryVersion"
}
playServicesLibraryVersion is 15.0.1, which is the latest. The project builds successfully, but the errors arise specifically when I'm deploying to target. My target device is running Android P and I'm using Android Studio 3.1.2.
If I add implementation "com.google.android.gms:play-services-ads:$rootProject.ext.playServicesLibraryVersion" I get a Multiple Dex error.
Any ideas?
Update: issue was resolved when I did a clean build, invalidated cache, and used api instead of implementation in the build.gradle. I added both libraries to my dependencies.
So i'm using the following firebase library version in my app:
Project's build.gradle:
firebase_version = '15.0.0'
And the following library dependencies:
App's build.gradle:
implementation "com.google.firebase:firebase-firestore:$firebase_version"
It looks like these versions were released on the 10th of April, however when compiling my app with the updated libraries, it fails to run with the following error:
error: cannot access zzbgl
class file for com.google.android.gms.internal.zzbgl not found
When checking all my library versions, my build.gradle has the following error:
not sure if anyone has experienced this by any chance since the latest updates? Before updating from 12.0.1, everything was working.
Thanks
Simply override (add to your gradle file) the conflicting library, updating the version to match the ones you already have in your gradle file. Somewhere in your dependencies someone is using an older version of this library and it's crashing with your version:
implementation "com.google.android.gms:play-services-auth:$firebase_version"
Error
How can I add Firebase UI dependency? I'm not sure which version is compatible with my sdk version 26.
Take a look at release notes for FirebaseUI i.e. https://github.com/firebase/FirebaseUI-Android/releases
It contains following (for latest version...3.0)
This version has the following notable transitive dependencies:
Firebase / Play services 11.4.2
Support Library 26.1.0
Facebook SDK 4.27
In general you can run something like following to list transitive dependencies that exist in your build.
./gradlew -q dependencies <your_module>:dependencies
I am having a problem while using android libraries to android studio.
How to know the latest version of the library which is appended in the end of the statement in the gradle file.
For example : If I want to add the Google play services, I can add this line
compile 'com.google.android.gms:play-services:7.8.0'
If I updated the library using sdk manager,then how to get the new version number?
Thanks
I usually after updating my android sdk check at
Project Structure > app > Dependencies > + button > Library dependency
My project depends on maps. So I have compile 'com.google.android.gms:play-services-maps:7.0.0' in my build.gradle file. But gradle downloads all the play services, including fitness, games, wallet, etc. How to depend just on map and it's dependencies, but not the whole play-services?
Ok, I found a problem. The issue was that gradle was configured to work in offline and for unknown reason it was adding all the play-services into the project (perhaps, because full play-services was the only downloaded dependency, that contained play-services-maps).
Allowing gradle to work online and doing gradle sync — and viola, now only play-services-base and play-services-maps are dependencies.