Android app crashes when adding firebase crashlytics - android

I'm migrating from fabric to firebase crashlytics. I've been able to migrate to AndroidX (which I believe was necessary). Then I followed this steps but the app crashes when I add the crashlytics dependency (everything works if I comment out the crashlytics implementation line).
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
When using a physical phone, I don't get any error, just some SQLiteEventStore and JobInfoScheduler log and the sigkill:
https://gist.github.com/raquelhortab/60ebd50ead5aa820c34bc271a09e94b7
When using an emulator I get an okhttp3 error (you can see it in the gist above). Again, the only difference is the crashlytics line in the app's build.gradle.
The okhttp3 error made me think I might have to update glide and okhttp3 (which is not that easy) but it works just fine without crashlytics so I don't think that's the problem.
I've also tried the crashlytics version 17.2.2 and newer versions of firebase-related implementations, you can find the gradle files in the gist as well.
PS: I apologize if this has already been answered, searching crashes and crashlytics leads to many questions of crashes that are not realated to crashlytics (which is logic)

It doesn't seem firebase issue from the error stack provide. Try to add the same version for com.squareup.okhttp3:logging-interceptor and com.squareup.okhttp3:okhttp
try 3.4.1

Related

Superclass androidx.core.app.f of androidx.activity.ComponentActivity is declared final

I wanted to update the version of the application in the Play Store, but in the tests I started getting this error.
Superclass androidx.core.app.f of androidx.activity.ComponentActivity is declared final
According to the google issues tracker this is new, maybe someone has a solution to this problem.
I added
-keep class androidx.core.app.** { *; }
In the proguard rules to solve the issue.
Edit: minus sign (-) needs to be before the line
On 27.07.2022 Google team members posted that the bug has been fixed.
and on 09.08.2022 they added some explanation that you can find in this link.
In two words:
In pre-launch testing app-crawler apk and the app apk generated different ‘keep rules’ for shrunk.
This will cause ‘no such method’ or ‘superclass will be declared final’.
Did you upgrade some libraries in your build.gradle?
Coroutines maybe?
We have this exception reported too and it has the same stack trace as an older exception we had before, so possibly equally related to the Kotlin coroutines lib version:
java.lang.VerifyError: Verifier rejected class. Code working fine in debug mode, but not throwing this error in release mode
You try update implementation 'com.google.android.gms' in build.gradle to lastest version
I had the same issue with Flutter. I remove Firebase from build.gradle
// implementation platform('com.google.firebase:firebase-bom:29.0.4')
also downgrading firebase to 29.0.2 is working too.
I added this line into gradle.properties
android.enableR8.fullMode=true
I hope it will help you too
For builds made before August 2022
If your APK/App Boundle was created before August 2022, the issue might be related to an internal issue by Google.
See this issue tracker: https://issuetracker.google.com/issues/237785592?pli=1
For me it was enough to build a new release on my machine (increasing version number at least by 1!) and upload it... Afterwards, the problem was gone.

I cannot view crash detail of Firebase Crashlytics for android and got stuck on "Build and run your app"

I try to setup Firebase Crashlytics after done setup Firebase.
The crashes was sent successfully.
Which I can see them in firebase dashboard.
But When I enter crashlytics to see crash detail.
I got stuck on step 3 (Build and run your app , We'll be listening for your app to communicate with our servers.).
I already try uninstall-reinstall , remove fabric or firebase crash report part but not working at all.
Here is firebase,fabric,crashlytics version I use.
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.0.2'
classpath 'io.fabric.tools:gradle:1.26.1'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9#aar')
{
transitive = true;
}
Any solution?
Guys I have commented earlier here for solution but fortunately got its solution on my own.
Initialization of app is not mentioned anywhere to get crashlytics report on our console!
Step 1. First follow the official doc's link to include all dependencies as it is given there and setup your firebase app through firebase console.
Step 2. Now do the following initialization in your base application class or base activity class.
FirebaseApp.initializeApp(getApplicationContext());
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
Now clean you project and do some force crash for few times, you should be able to see your crashlytics report on your firebase console
Refer this answer also OkHttp timeout issue
I had the same problem.I was working in an old project with the old Fabric Crashlytics and Google Analytics
So, this are the steps I did to see the screen in Firebase of "Installation successful!"
Delete everything related to Fabric from the project-level build.gradle
Delete everything related to Fabric from the app-level build.gradle
Search and delete all calls to Crashlytics within the project
Clean Project
Build Project
and finally, start again following the steps from this link
The first 4 steps were the most important in my case. They cleaned every trace of the Fabric library that I had previously installed.
Firebase Document also tells us to wait 5 minutes https://firebase.google.com/docs/crashlytics/test-implementation?platform=android
This is what is said in document :
To test the implementation, press the button in your app to force the
crash, then reopen your app so that Crashlytics can send the crash
report to Firebase. It may take up to five minutes for the report to
appear in the Firebase console.
I also followed #Shetanks answer https://stackoverflow.com/a/59906454/14784590
And its working after few crashes in two different devices.
Try updating your dependencies according to the Get Started page.
It should be something like:
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9')
Remove the line:
transitive = true;
If you have multiple apps in the project then make sure that right app is selected for communication in the Firebase crashlytics console.
I searched everything on the web, at the end I realized that I have selected the wrong app in crashlytics console.
I have the same problem as well and tried out all the possible solutions. I just deleted the project from firebase console and recreate the project. It works for me.
Note: It is not a good approach If you have a lot of data in your firebase project. I would suggest using this approach If you are using firebase only for crashlytics.
my case i selected Crashlytic for android, not ios

Firebase Crashlytics invalid api KEY AndroidX Gradle 3

Like many people, I am not able to add my application with Firebase Crashlytics.
I followed all the steps from the official documentation.
Also I previously checked and added my application to Firebase and everything is working fine.
My issue is the following:
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: null.
Check the Crashlytics plugin to make sure that the application has been added successfully!
Contact support#fabric.io for assistance.
I have the google-services.json file set correctly.. From the official documentation, it should works now without anything else to do..
Edit - Solution
Like I said in the comments, I found the issue. It's because of the Gradle version that I was using. I moved my project to support AndroidX and I was using the latest version 3.3+ but with this version the google-services.json file is not parsed during the build phase. It is resolved with the 3.2+ version.
From Firebase team, only stable version are working.
Is your project built to support instant apps (i.e. you have a base feature module, installable module, and instant app module)? I've been dealing with this exact error for the last day and a half, and what finally fixed it for me was adding crashlytics { instantAppSupport true } to the bottom of my gradle file for my base feature module. If you are built for instant apps, this might be worth a shot.
Are you sure you have added the Crashlytics API Key in one of these files?
AndroidManifest.xml:
<meta-data
android:name="io.fabric.ApiKey"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxx" />
Fabric Properties:
# Fabric properties file: app/fabric.properties
apiSecret=xxxxxxxxxxxxxxxxxxxxxxxxxxx
apiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxx

appcompat-v7:28.0.0-rc02 doesn't work with design:28.0.0-rc01(should be rc02, but we can't)

com.android.support:appcompat-v7:28.0.0-rc02
com.android.support:design:28.0.0-rc01 -> should be rc02, but there's no rc02 actually.
error:
app/build.gradle:74: Error: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).
Found versions 28.0.0-rc02, 28.0.0-rc01. Examples include com.android.support:animated-vector-drawable:28.0.0-rc02 and com.android.support:cardview-v7:28.0.0-rc01 [GradleCompatible]
I know it's a warning, we have turned to warn as the errors in CI in order to avoid the potential dead crashes, well, any solution except turn off option for CI?
issue
UPDATE
Design library version 28.0.0-cr02 published.
OLD ANSWER
According to this link
https://mvnrepository.com/artifact/com.android.support/design?repo=google
design:28.0.0-rc02 not yet published.
So all you can do for now is use the previous version for appcompat and wait until design library new version28.0.0-cr02 release.
So for now use this :
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
I don't know why... But they(sdk devs) behaving like Microsoft..
"Ohh..It compiles, lets ship it".
They just launch and don't care about bugs.. after updating to latest libs every time, first thing i get is..
"Layout editor preview errors.".
i hope it will be easy next time. :/
Keep track of the library here, until its published, use rc01 for other ones.
https://mvnrepository.com/artifact/com.android.support/design?repo=google
That's why I use stable versions always
If you are developing an app, you don't want to face these type of errors.
At the time of answering the current most stable version is 27.1.1 and second 28.0.0-rc02.
I suggest use 27.1.1 until 28 stable version release.
implementation 'com.android.support:appcompat-v7:27.1.1'
Sync again
No need of Invalidate/ Restart, Just restart would be okay. Or closing project and reopening from recent would be faster then restart.
Track the support library release.
Replace your
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
with
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
Looks like this should no longer be an issue. Looking at the link below, i think that whatever hiccups were encountered by OP are no longer relevant.
https://mvnrepository.com/artifact/com.android.support/appcompat-v7/28.0.0-rc02
About the error message "All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes)." The solution is outlined here (the answer by João Paulo Paiva).
To rid yourself of the error message, you have to basically include each package name mentioned in the warning - com.android.support:animated-vector-drawable:28.0.0-rc02 and com.android.support:cardview-v7:28.0.0-rc01
Essentially, manually add the following lines to your build.gradle
implementation com.android.support:animated-vector-drawable:28.0.0-rc02
implementation com.android.support:cardview-v7:28.0.0-rc02
You may encounter more such warnings - the solution is to keep subsequently adding the libraries/dependencies mentioned (and updating the version to 28.0.0-rc02 as well) until the warnings go away. I had this issue, and after the first lot, I didn't get any more, but YMMV!
1.Go to project/.idea/libraries folder on your file system and see which libraries are different.
2.You will have to manually include these libraries with the same version in your build.gradle file.
3.Then, sync your project
In Your Case:-
Add This Dependency :-
implements 'com.android.support:cardview-v7:28.0.0-rc02'
Add all dependency with Latest version which shows in error message.
I close this ticket, the problem has been solved that Google has updated design library to 28.0.0-rc02 .

Crashlytics timed out during initialization

When I run my Android app with Crashlytics, it hangs at startup, and I get a TimeoutException.
Then, when I try to crash my app, I get another TimeoutException, with the message CrashlyticsCore: Failed to execute task.
The crash doesn't appears on my Firebase console.
I set up Crashlytics Firebase's tutorial, and I do not have a Fabric account.
I also followed this commit, making me add the gms.google-services plugin.
Thanks for your help.
I had this problem today and in my case downgrading from
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
to
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.3'
solved my problem.
I had the same problem today.
Downgrading didn't work for me.
Solved by deleting the google-services.json file and reconnecting my app to Firebase again (new google-services.json was generated)

Categories

Resources