B4A Library Crashlytics - crash reports

Status
Not open for further replies.
  1. Make sure to use B4A v13.4+ with the recommended SDK: https://www.b4x.com/b4a.html
  2. Follow firebase integration tutorial: Integrating Firebase Services
  3. Add a reference to OkHttpUtils2.
  4. Add to Main:
    Code: Copy
    #AdditionalJar: com.google.firebase:firebase-crashlytics
    #AdditionalJar: com.google.android.datatransport:transport-runtime
    #AdditionalJar: com.google.android.datatransport:transport-backend-cct

  5. Make sure that #VersionName attribute is not empty. It will not work with an empty value.
  6. Add to manifest editor:
    Code: Copy
    CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
    CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
    CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)
  7. Make sure that Crashlytics is enabled in Firebase console and crash the app in release mode. You can use this code:
    Code: Copy
    Dim i As Int = "aaa"
The crash should appear in Firbease console under Quality - Crashlytics after a few minutes.
 
Last edited:
Do we need to register to fabric.io site because waited about 10 minutes and crash reports are not coming yet. maybe it takes time.

edit: ok nearly after 10 minutes , they started to come. Thanks !
 
Last edited:
The long GUID id should be changed whenever you make a new release. It uniquely identifies the build.
You can change one or more of the hex digits.
Is there an automatism or does it have to be changed manually?
 
you can write a b4j app which is called in a custombuildaction which then changes the B4A File (the Manifestpart) using regex for ex. to find the value and change it.
I know, but I prefer programming that in Visual Studio. ;)
 
Google has deprecated the old method. The instructions were updated. Note that the old class is no longer required.

  1. Make sure to use B4A v10.2+ with the recommended SDK: https://www.b4x.com/b4a.html
  2. Follow firebase integration tutorial: Integrating Firebase Services
  3. Add a reference to OkHttpUtils2.
  4. Add to Main:
    Code: Copy
    #AdditionalJar: com.google.firebase:firebase-crashlytics

  5. Make sure that #VersionName attribute is not empty. It will not work with an empty value.
  6. Add to manifest editor:
    Code: Copy
    CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
    CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
    CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)
  7. Make sure that Crashlytics is enabled in Firebase console and crash the app in release mode. You can use this code:
    Code: Copy
    Dim i As Int = "aaa"
The crash should appear in Firbease console under Quality - Crashlytics after a few minutes.


hi


If we use the

B4X: Copy
    Try  
        Dim i As Int = "aaa"
    Catch
        Log(LastException.Message)
    End Try

Will this error be sent to Firebase again?

If the answer is no, how can we send this error to Firebase?

thankyou
 
Last edited:
Will this error be sent to Firebase again?
I don't see the error in Firebase Console If I use the try..catch.
If the answer is no, how can we send this error to Firebase?
Use the events of Firebase Analitics (I don't know other way):
B4X: Copy
    Catch
        Log(LastException.Message)
        Starter.analytics.SendEvent("FirebaseError", LastException.Message)
 
Do we still need the Crashlytics class in the project?
No, If you use the new Firebase Crashlytics instructions:
 
No, If you use the new Firebase Crashlytics instructions:


Hello
Thank you for your guidance

Do we need to add a " Firebase Crashlytics " library
and
 
I have enable crash analitics on firebase console, but don't exit from this status (waiting)

1601122204320.png
 
Last edited:
Status
Not open for further replies.
Back
Top