Android Question B4A 10.2 Crashlytics Integration Error (SOLVED)

walterf25

Expert
Licensed User
Longtime User
Hi All, I just upgraded to the latest B4A 10.2 and i am now seeing the app crashing as soon as it starts, before upgrading the app was working fine, i've gone through the notes about version 10.2 but can't seem to find what the problem is, i checked the unfiltered logs and here's the error I see.

Is there anything I may be missing?

.
. | |
. | |
. | |
. \ | | /
. \ /
. \ /
. \/
.
The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
.
. /\
. / \
. / \
. / | | \
. | |
uid=10593(com.strom.ergonomics) identical 1 line
. | |
.
Shutting down VM
Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:com.strom.ergonomics flg=0x4000010 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.googlequicksearchbox.GelStubAppWatcher
FATAL EXCEPTION: main
Process: com.strom.ergonomics, PID: 15174
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
at android.app.ActivityThread.installProvider(ActivityThread.java:7636)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7176)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7039)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7007)
at android.app.ActivityThread.access$1700(ActivityThread.java:272)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2064)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8034)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Caused by: java.lang.IllegalStateException: The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:123)
at com.google.firebase.crashlytics.FirebaseCrashlytics.init(FirebaseCrashlytics.java:165)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.buildCrashlytics(CrashlyticsRegistrar.java:54)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.access$lambda$0(Unknown Source:4)
at com.google.firebase.crashlytics.CrashlyticsRegistrar$$Lambda$1.create(Unknown Source:6)
at com.google.firebase.components.ComponentRuntime.lambda$new$0(com.google.firebase:firebase-components@@16.0.0:69)
at com.google.firebase.components.ComponentRuntime$$Lambda$1.get(Unknown Source:7)
at com.google.firebase.components.Lazy.get(com.google.firebase:firebase-components@@16.0.0:53)
at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(com.google.firebase:firebase-components@@16.0.0:158)
at com.google.firebase.FirebaseApp.initializeAllApis(com.google.firebase:firebase-common@@19.3.0:563)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:304)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:268)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:253)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@19.3.0:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2113)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2087)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@19.3.0:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:7631)
... 11 more

I have the following entries in my manifest file
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)

and I have also added the following line to the Main Activity
B4X:
#AdditionalJar: com.google.firebase:firebase-crashlytics

Not sure what else I need to be doing?

Thanks, everyone!
Walter
 

walterf25

Expert
Licensed User
Longtime User
You need to update your SDK.
Follow these steps:
I have already done that, but just in case i re-downloaded the latest sdk and tried again, but i am still seeing the same issuing, the app crashes right when it starts, I went through the unfiltered logs one more time and I still see the same crash posted on the first post and I also see this other crash as well.
Class com.google.firebase.auth.FirebaseAuthRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.auth.FirebaseAuthRegistrar
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at java.lang.Class.forName(Class.java:379)
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-components@@16.0.0:80)
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-components@@16.0.0:73)
at com.google.firebase.FirebaseApp.<init>(FirebaseApp.java:419)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:300)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:268)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:253)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2113)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2087)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:7631)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7176)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7039)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7007)
at android.app.ActivityThread.access$1700(ActivityThread.java:272)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2064)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8034)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Caused by: java.lang.ClassNotFoundException: com.google.firebase.auth.FirebaseAuthRegistrar
... 25 more
Class com.google.firebase.firestore.FirestoreRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.firestore.FirestoreRegistrar
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at java.lang.Class.forName(Class.java:379)
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-components@@16.0.0:80)
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-components@@16.0.0:73)
at com.google.firebase.FirebaseApp.<init>(FirebaseApp.java:419)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:300)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:268)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:253)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2113)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2087)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:7631)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7176)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7039)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7007)
at android.app.ActivityThread.access$1700(ActivityThread.java:272)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2064)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8034)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Caused by: java.lang.ClassNotFoundException: com.google.firebase.firestore.FirestoreRegistrar
... 25 more
Class com.google.firebase.messaging.FirebaseMessagingRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.messaging.FirebaseMessagingRegistrar
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at java.lang.Class.forName(Class.java:379)
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-components@@16.0.0:80)
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-components@@16.0.0:73)
at com.google.firebase.FirebaseApp.<init>(FirebaseApp.java:419)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:300)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:268)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:253)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2113)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2087)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:7631)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7176)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7039)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7007)
at android.app.ActivityThread.access$1700(ActivityThread.java:272)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2064)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8034)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Caused by: java.lang.ClassNotFoundException: com.google.firebase.messaging.FirebaseMessagingRegistrar
... 25 more
Class com.google.firebase.database.DatabaseRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.database.DatabaseRegistrar
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at java.lang.Class.forName(Class.java:379)
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-components@@16.0.0:80)
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-components@@16.0.0:73)
at com.google.firebase.FirebaseApp.<init>(FirebaseApp.java:419)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:300)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:268)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:253)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2113)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2087)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:7631)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7176)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7039)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7007)
at android.app.ActivityThread.access$1700(ActivityThread.java:272)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2064)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8034)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Caused by: java.lang.ClassNotFoundException: com.google.firebase.database.DatabaseRegistrar
... 25 more
Class com.google.firebase.storage.StorageRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.storage.StorageRegistrar
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at java.lang.Class.forName(Class.java:379)
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-components@@16.0.0:80)
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-components@@16.0.0:73)
at com.google.firebase.FirebaseApp.<init>(FirebaseApp.java:419)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:300)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:268)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:253)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2113)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2087)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:7631)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7176)
at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7039)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7007)
at android.app.ActivityThread.access$1700(ActivityThread.java:272)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2064)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8034)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Caused by: java.lang.ClassNotFoundException: com.google.firebase.storage.StorageRegistrar
... 25 more

When I run the SDK Manager I also see this error pops up
error.PNG


I really need to integrate Firebase Crashlytics into my app.

Walter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I had the same error as you, I also had no problems with unzip.
Try as I already wrote: 7-Zip.
I'm out.
I unzipped all files using 7-Zip but I am still seeing the same issue, anyone else has come across this issue, this is ridiculous.

Walter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
The App only crashes when this line is added

B4X:
#AdditionalJar: com.google.firebase:firebase-crashlytics

If I remove that line, the app compiles but i do not see any crash logs in the firebase console when a crash is forced.

according to Erel's updated instructions the class is no longer needed but we do need to insert the above AdditionalJar argument
https://www.b4x.com/android/forum/threads/crashlytics-crash-reports.87510/

Problem is that if I insert the AdditionalJar argument then the app crashes upon start.

What am I missing?

Walter
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The App only crashes when this line is added
Likely to be a misconfigured SDK. Download the two packages and unzip them in a new folder: https://www.b4x.com/b4a.html
You don't need to run B4A Sdk Manager at all.

If it doesn't work then post the error message. The logs above are not related.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Likely to be a misconfigured SDK. Download the two packages and unzip them in a new folder: https://www.b4x.com/b4a.html
You don't need to run B4A Sdk Manager at all.

If it doesn't work then post the error message. The logs above are not related.
Hi Erel, I have already done what you are suggesting, I created a whole different folder where I placed the two downloaded folders, and i don't see any error messages in the unfiltered logs, the only errors I see are the ones I already posted, I spent literally the whole day trying to figure this out and finally gave up, I've used crashlytics before and never had so much issues getting it to work, I will give it another try tomorrow.

By the way the SDK Manager runs fine now, I don't see any errors, but I still can't get the app to run with FirebaseAnalytics library.

Walter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Found the problem, I had the wrong entries in my Manifest file, don't I feel like a complete IDIOT!!, a whole week trying to figure this out and today i finally realized I had the wrong macro entry for Crashlytics.

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)
I needed to have this and instead I had
B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics

?????

Walter
 
Upvote 0

Jack Cole

Well-Known Member
Licensed User
Longtime User
I don't see how you're an idiot. Maybe it's because I am one too?

Anyway, to use Crashlytics, you need the line that you include above with Crashlytics in it. If you don't have it, then you are not including Crashlytics. My app crashes as soon as I include this line:

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
 
Upvote 0

Jack Cole

Well-Known Member
Licensed User
Longtime User
I have delved into this a bit further. I can get my app to run with the following lines in the manifest.

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

Only if I do not include the following:

B4X:
#AdditionalJar: com.google.firebase:firebase-crashlytics

So, maybe that line is no longer needed? If I include that line, it crashes when any Firebase related service is referenced in the manifest.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I take it back. It worked once then after re-compiling, it doesn't work anymore.
these are the only manifest entries that you need:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

Walter
 
Upvote 0

Jack Cole

Well-Known Member
Licensed User
Longtime User
I was able to get it to work, but it seems like it shouldn't be working.

Here are my manifest lines:

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
'CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
'CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

Makes me wonder if the macro for Crashlytics includes the core Firebase and Analytics components. Seems like it is working fine this way. It initializes a Firebase Analytics variable without problem.
 
Upvote 0

asales

Expert
Licensed User
Longtime User
I take it back. It worked once then after re-compiling, it doesn't work anymore.
Same problem here.

I was able to get it to work, but it seems like it shouldn't be working.

Here are my manifest lines:

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
'CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
'CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

Makes me wonder if the macro for Crashlytics includes the core Firebase and Analytics components. Seems like it is working fine this way. It initializes a Firebase Analytics variable without problem.
Sadly, this doesn't worked to me.
I followed all the steps (and install a new SDK from scratch), but don't works.
The old class still working fine, but the new don't.
 
Upvote 0
Top