Android Crashlytics stuck at "Build and run your app" - android

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.

Related

Firebase crashlytics data not showing up in dashbord even after a day crashlytics was integrated to android app

I added firebase crashlytics to my android app about a day ago. But I still see following getting started guide on the crashlytics page of the firebase console.
Following is my git diff for adding crashlytics.
project level gradle file:
## -5,10 +5,12 ## buildscript {
repositories {
jcenter()
google()
+ maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
- classpath 'com.google.gms:google-services:4.3.0'
+ classpath 'com.google.gms:google-services:4.3.2'
+ classpath 'io.fabric.tools:gradle:1.31.2' // Crashlytics plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
## -18,6 +20,7 ## allprojects {
repositories {
jcenter()
google()
+ maven { url 'https://maven.fabric.io/public' }
}
}
app level gradle file:
## -1,4 +1,5 ##
apply plugin: 'com.android.application'
+apply plugin: 'io.fabric'
android {
compileSdkVersion 29
## -93,6 +94,8 ## dependencies {
implementation 'com.google.firebase:firebase-firestore:21.2.0'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'
+ implementation 'com.google.firebase:firebase-analytics:17.2.0'
+ implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation 'org.dizitart:nitrite:3.2.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
I crashed my app several times using following method.
Crashlytics.getInstance().crash();
My device has an internet connection.
I tested using both a debug build and a release build (signed apk).
What could be the reason the dashboard not showing up any crash statistics yet, even after a day of crashlytis setup in the app?
Add this at the bottom of the app level build gradle
apply plugin: 'com.google.gms.google-services' and add google json to your app folder
Remove the line "Crashlytics.getInstance().crash()",
Run your app on a Real Device,
Unplug device,
Close the app,
Open the app on your device as it's unplugged.
Now Check the FireBase again. You should see some charts in Crashlytics Tab.
For testing crashes you can do the above process, but this time with code "Crashlytics.getInstance().crash()".
Note:  Be sure to place this line outside your App Delegate’s "didFinishLaunching" method

Save android exception to file

I have device with very poor debug capabilities, and it's inside car, can't connect it to PC. My program works on 3 different emulators and on my personal phone. but in car it sometimes crashes(like exception). I have no idea in which place of program it happens, so I can't just do try...catch and save printStackError. But I want save exception which leads to program termination to txt file.
All founded answers going to try...catch which not an option.
Does Android have something like onCrash or similar.
Update 1:
I can't use Google play or google-services, because it's standalone application without Google play on device.
You can use Firebase Crashlytics in your project. It will send the crash logs to the Crashlytics page in your firebase project window
Step 1
In your project-level build.gradle, update your google-services to
version 3.1.2 or later, then add the Crashlytics repositories and
dependency:
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.2' // Google Services plugin
// Add dependency
classpath 'io.fabric.tools:gradle:1.31.1' // Crashlytics plugin
}
}
allprojects {
// ...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
// ...
}
}
Step 2
In your app-level build.gradle, add the Crashlytics
dependencies:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
dependencies {
// ...
// (Recommended) Add Analytics
implementation 'com.google.firebase:firebase-analytics:17.2.0'
// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}
Here's the full document for Firebase Crashlytics

Adding realtime database to my app on android studio - Failed to resolve: firebase-database-15.0.0

i've been working with firebase to access an activity on my project. Everything works fine, no compilation errors. However after i go to tools > firebase i can connect to my app easily, however when i try to click Add Real time database it shows me this:
build.gradle will include these new dependencies:
compile 'com.google.firebase:firebase-database:16.0.1:15.0.0'
Since compile is deprecated i use implementation, and when i do
Implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
i get the following error Failed to resolve: firebase-database-15.0.0
and my sync fails.
Change Root Gradle to
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
}
}
allprojects {
// ...
repositories {
// ...
google() // Google's Maven repository
}
}
And App Gradle To
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
// 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'
Hope This May Help You
add jcenter() in your project-level gradle.
allprojects {
repositories {
google()
jcenter()
}
}
and keep remaining as #Tomin B said.

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