Firebase crashlytics not building even when downgrading versions - android

We're using Firebase in our app and while we are still on Support library 28 Not AndoridX.
i have managed to add Analytics and Performance monitoring and they work fine after researching the suitable versions that are compatible with support-lib 28.
Now i'm trying to add crashlytics and i'm getting build errors with each lib version starting from 17.0.0 going down all the way to 2.9.8
with 2.9.8 it get :
ERROR: Failed to resolve: com.google.firebase:firebase-crashlytics:2.9.8
Show in Project Structure dialog
Affected Modules: app
with 17.0.0 i get:
ERROR: Failed to resolve: com.google.firebase:firebase-
crashlytics:com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension_Decorated
Show in Project Structure dialog
Affected Modules: app
My project build.gradle:
buildscript {
ext.kotlin_version = '1.3.60'
repositories {
google()
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
}
ext {
firebaseAnalytics = "16.3.0" //Firebase SDK for Google Analytics compatible with support lib
firebasePerformanceMonitoring = "17.0.2" //Firebase SDK for performance monitoring compatible with support lib
firebaseCrashlytics = "17.0.0" //Firebase Crashlytics
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.google.gms:google-services:4.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.firebase:perf-plugin:1.3.1' // Performance Monitoring plugin
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0' // Crashlytics Gradle plugin.
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
jcenter()
google()
}
}
app module build.gradle dependencies block:
dependencies {
def supportLib_version = "28.0.0"
implementation "com.android.support:support-v4:$supportLib_version"
implementation "com.android.support:recyclerview-v7:$supportLib_version"
implementation "com.android.support:design:$supportLib_version"
........
implementation "com.google.firebase:firebase-analytics:$firebaseAnalytics"
implementation "com.google.firebase:firebase-perf:$firebasePerformanceMonitoring"
implementation "com.google.firebase:firebase-crashlytics:$firebaseCrashlytics"
}
While some might suggest that we migrate the project to AndroidX, this is a big project with many libraries and i'm not the only developer working on it, hence that won't be feasible IMT

Fabric/Firebaser here - I think that overall there is some incorrect versioning and dependency integration in this project that is causing issues.
You will unfortunately not be able to use Firebase Crashlytics until you upgrade to Android X, as it is a dependency for the Firebase Crashlytics SDK as described here.
You can still use the legacy Fabric Crashlytics SDK in Firebase however, and you can find the instructions for that here: https://firebase.google.com/docs/crashlytics/get-started?platform=android. I recommend taking out whatever Crashlytics setup you've attempted to integrate so far and follow the instructions there. For what it's worth, it looks like you're getting the versioning wrong, as this version does not exist:
com.google.firebase:firebase-crashlytics:2.9.8
firebase-crashltyics only has versions like 17.0.0 and upward. 2.9.8 is a version of our aforementioned legacy Fabric Crashlytics SDK, so you're looking to use something like this:
com.crashlytics.sdk.android:crashlytics:2.10.1
Hope this helps :)

Related

Android Crashlytics stuck at "Build and run your app"

I followed the tutorial exactly (https://firebase.google.com/docs/crashlytics/get-started?authuser=1&platform=android#android) and still can't see my app on firebase Crashlytics. here's my configuration:
in root build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath 'io.fabric.tools:gradle:1.31.0'
}
in app build.gradle
...
apply plugin: "io.fabric"
...
//Firebase
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-config:18.0.0'
implementation 'com.google.firebase:firebase-analytics:17.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
in Application
Fabric.with(this, Crashlytics());
I'm building and running the app on debug but nothing is happening, in the logs I see
I/CrashlyticsInitProvider: CrashlyticsInitProvider skipping initialization
I/CrashlyticsCore: Initializing Crashlytics Core 2.7.0.33
what could I be missing?
For anyone who is facing a similar issue, I have looked for many hours and eventually checked the merged manifest and figured there is a 3rd party library that was actually setting up their own Crashlytics config which overrides mine. So maybe look into that.
I eventually added this to my manifest:
<meta-data
tools:node="remove"
android:name="io.fabric.ApiKey"/>
Refer to the Firebase Crashlytics Docs.
Step 1: Add this code in your project level build.gradle file
buildscript {
repositories {
// Add the following repositories:
google() // Google's Maven repository
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
// ...
// Check for v3.1.2 or higher
classpath 'com.google.gms:google-services:4.3.0' // Google Services plugin
// Add dependency
classpath 'io.fabric.tools:gradle:1.31.0' // Crashlytics plugin
}
}
allprojects {
// ...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
// ...
}
}
Step 2 : Add this code in your app-level build.gradle file
apply plugin: 'io.fabric'
dependencies {
// ...
// Check for v11.4.2 or higher
implementation 'com.google.firebase:firebase-core:17.0.1'
// (Recommended) Add Analytics
implementation 'com.google.firebase:firebase-analytics:17.0.1'
// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}
Make sure you have added google-services.json and running your app in physical device or emulator having google play services.
credit goes to firebase for creating such a helpful docs.
This is Zubair from Fabric/Firebase. Could you try to make individual build and run event on a brand new simulator (where they've not installed/ran this app before). If issue persist, reach out to us AT "support#fabric.io" and include app name/bundle id and firebase project id in the email.

Cannot resolve github dependency even though my process is correct

Basically the problem is I cannot resolve GitHub dependency even though I added this to Project level build.gradle.
build.gradle (Project)
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
and app level build.gradle
dependencies {
implementation 'com.github.mukeshsolanki:country-picker-android:<latest-version>'
How can I fix this? What is this cause possibly? I already updated to the lastest version of Android Studio.
In the string implementation 'com.github.mukeshsolanki:country-picker-android:<latest-version>' at the app level build.gradle file you must replace <latest-version> substring with the actual version of the library. Currently the latest version is 2.0.1.
So the result string should be this: implementation 'com.github.mukeshsolanki:country-picker-android:2.0.1'

Failed to resolve: play-services-tasks

I have been tryong to add FCM to my android application for almost 48 hours now. I am keep on failing with these two errors on Android Studio. I have tried all the solutions in this post. Still I couldn't fix it.
I want firebase cloud messaging to be integrated in my app. So I did the followings.
Created an app in the firebase console
Included the .json config file
Added the SDK
implementation 'com.google.firebase:firebase-messaging:17.0.0'
(In the app level gradle)
apply plugin: 'com.google.gms.google-services' (In the app level gradle file last
line)
classpath 'com.google.gms:google-services:4.0.1'
(In the project level gradle)
Added the repository
google() (In the project level gradle)
I have tried syncing many times and I keep on getting the error
Failed to resolve: play-services-tasks Open File
Failed to resolve: play-services-basement Open File
On a side note, I am using the gradle plugin 3.1.3
classpath 'com.android.tools.build:gradle:3.1.3'
Can someone please give me a hand here please.
In gradle (project),
just change the position of google() before jcenter(),
and the error is gone.
repositories {
google()
jcenter()
}
jcenter() sometimes act as a mirror repository for some Google dependencies. During Gradle building process, it looks for dependencies in the first entry listed in your repositories {...} block. So if this repository is broken or something bad occurs with any dependency the process will fail.
Here there is a recommended order for repository list
repositories {
google()
maven {
url 'https://maven.google.com/'
}
jcenter()
}
Put google() repository at the very first line of dependencies. It will work.
Add in your app.gradle
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
and upgrade your dependencies version.
I had this occurring due to outdated build tools version. Updating from 28.0.2 to 28.0.3 resolved it.
buildToolsVersion '28.0.2'
to:
buildToolsVersion '28.0.3'
in build.gradle file.

Gradle sync fails - play-services-measurement-base

I have a problem on my Android project, I can't build, this is the error I have:
Failed to notify dependency resolution listener.
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.2,15.0.2], [15.0.4,15.0.4]], but resolves to 15.0.4. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
I tried many different solution I found but the problem persists.
I have the right dependencies and repositories on gradle file on project root:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'
}
and
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven {
url "https://maven.google.com"
}
}
On my app gradle I have the following dependencies:
implementation "com.google.android.gms:play-services-maps:15.0.1"
implementation "com.google.android.gms:play-services-places:15.0.1"
implementation "com.google.android.gms:play-services-gcm:15.0.1"
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.android.gms:play-services-analytics:15.0.2"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-tagmanager:15.0.2"
implementation "com.google.firebase:firebase-core:16.0.0"
Some suggestions?
The solution was update the following dependencies:
implementation "com.google.android.gms:play-services-analytics:16.0.0"
implementation "com.google.android.gms:play-services-tagmanager:16.0.0"
I just added right after the apply plugin: 'com.google.gms.google-services' at the bottom of my build.gradle :
apply plugin: 'com.google.gms.google-services'
// Work around
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
I had the same exact error, upgrading analytics was the key:
implementation 'com.google.android.gms:play-services-analytics:16.0.0'
I know you thought everything is updated referring to the official website, but writing 15.0.0 and looking for suggestions works better.
Update project gradle play service dependency with latest release :
classpath 'com.google.gms:google-services:4.0.1' and
Update project firebase products usage as per firebase latest release note
this shoud be on top if you use firebase libraries:
implementation "com.google.firebase:firebase-core:16.0.0"
This worked for me.this shoud be on top if you use firebase libraries:
implementation "com.google.firebase:firebase-core:15.0.0"
In my case the issue was OneSignal, which somehow broke everything down.
They even have a dedicated library for this: https://github.com/OneSignal/OneSignal-Gradle-Plugin
and the actual issue was that OneSignal was inside my app-level gradle, instead of root one.
Freaking ridiculous!
Check Answer by Bhupendra Acharya from
https://groups.google.com/forum/#!topic/firebase-talk/XbGR-YrsTTA works for you. I got the following error
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
While using
implementation 'com.google.firebase:firebase-core:16.0.1'
And resolved by updating the version
implementation 'com.google.firebase:firebase-core:16.0.4'
My problem was that I was importing oneSignal gradle plugin but I do not import the full apply plugin: 'com.google.gms.google-services'.
To fix I just had to add the implementations I was using.
For future users: Open build.gradle files and just hover your mouse on the dependencies and a tooltip gonna show up telling your the newest version and that should solve your problem.
Beware that Firebase Documentations does not have the newest versions.
update classpath for com.google.firebase:firebase-core:16+
classpath 'com.google.gms:google-services:4.2.0'
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
Try this one , place maven url on top inside repositories in build.gradle
Update build.gradle
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2' //< update version
classpath 'com.google.gms:google-services:3.1.1' //< update version
}
}
This would help you I guess
Update the build.gradle file from the project root folder. I've tried this and it was helping.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
----
}}
Make sure you added following line in bottom of app gradle
apply plugin: 'com.google.gms.google-services'
Make sure you are using compatible google-services in project level gradle
dependencies {
classpath 'com.google.gms:google-services:4.0.1'
}
Check if you have added following dependency
implementation 'com.google.firebase:firebase-core:16.0.1'
I have answered a similar issue here. You need to keep versions of play services and firebase to latest one. Check here for links
https://stackoverflow.com/a/52696667/3333878
Try to set
classpath 'com.google.gms:google-services:3.2.1'
instead of
classpath 'com.google.gms:google-services:4.0.1'
It's helped in my case, but I don't know the cause of the error.

Android Studio Error The library com.google.android.gms:play-services-measurement-base

How to this i am new on Android Studio.
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.0,15.0.0], [15.0.2,15.0.2]], but resolves to 15.0.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
As reported here:
You will need to update the version of the latter dependency to 15.0.2. This addresses the issue where version 3.3.0 of the Google Services Gradle plugin reports: The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.0,15.0.0], [15.0.2,15.0.2]], but resolves to 15.0.2...
Then update your google play services plugin to 3.3.0
classpath 'com.google.gms:google-services:3.3.0'
and update the dependencies to 15.0.2.
Resolve this issue with me - If You are choosing Firestore Database then do this:
first We will add updated these things in Gradle :
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
}
}
allprojects {
// ...
repositories {
// ...
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
after this update :
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
implementation 'com.google.firebase:firebase-core:16.0.0'
// Getting a "Could not find" error? Make sure you have
// added the Google maven respository to your root build.gradle
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
Then Rebuild or Sunc Now , issue will be resolve.
if You are working on RealTime Database then do this thing :-
Set Dependency :
implementation 'com.google.firebase:firebase-database:15.0.0'
and remove above FireStore Dependency.
This will sure resolve your issue ... If you like then vote for me
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
}
}
This works for me. By adding the latest version, i.e 4.0.1

Categories

Resources