Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing class com.google.android.datatransport.runtime.ForcedSender in Crashlytics 18.3.0 #4223

Closed
c0ff33-b34n opened this issue Oct 19, 2022 · 35 comments
Assignees
Labels
api: crashlytics type: bug Something isn't working

Comments

@c0ff33-b34n
Copy link

  • Android Studio version: Android Studio Dolphin | 2021.3.1 Patch 1
  • Firebase Component: Crashlytics
  • Component version: 18.3.0

Describe the problem

If a crash occurs within the Android app (e.g. by throwing a NullPointerException on the press of a button within the app), when restarting the app the app does not load and crashes due to missing the com.google.android.datatransport.runtime.ForcedSender class, which was newly added in this version.

This occurs when updating to 18.3.0, using the crashlytics dependency only.
implementation 'com.google.firebase:firebase-crashlytics:18.3.0'
I am not using the BOM dependency (so do not know if this dependency is resolved when using BOM, but it's definitely missing for the above usage.)

I have reverted to 18.2.13 in the meantime as it is stable.

Steps to reproduce:

What happened? How can we make the problem occur?
By updating to Crashlytics 18.3.0, crashing the app then trying to relaunch.

@argzdev
Copy link
Contributor

argzdev commented Oct 19, 2022

Thanks for reporting, @c0ff33-b34n. I was able to reproduce the same behavior.

Adding some stacktraces:

2022-10-20 00:20:39.009 18250-18294/com.argz.issue4176 E/AndroidRuntime: FATAL EXCEPTION: Thread-2
    Process: com.argz.issue4176, PID: 18250
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/datatransport/runtime/ForcedSender;
        at com.google.firebase.crashlytics.internal.send.ReportQueue.lambda$flushScheduledReportsIfAble$0$com-google-firebase-crashlytics-internal-send-ReportQueue(ReportQueue.java:128)
        at com.google.firebase.crashlytics.internal.send.ReportQueue$$ExternalSyntheticLambda1.run(Unknown Source:4)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.datatransport.runtime.ForcedSender" on path: DexPathList[[zip file "/data/app/com.argz.issue4176-ilDe3NXyM92FVsLK9q1V1A==/base.apk"],nativeLibraryDirectories=[/data/app/com.argz.issue4176-ilDe3NXyM92FVsLK9q1V1A==/lib/x86, /system/lib, /system/product/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at com.google.firebase.crashlytics.internal.send.ReportQueue.lambda$flushScheduledReportsIfAble$0$com-google-firebase-crashlytics-internal-send-ReportQueue(ReportQueue.java:128) 
        at com.google.firebase.crashlytics.internal.send.ReportQueue$$ExternalSyntheticLambda1.run(Unknown Source:4) 
        at java.lang.Thread.run(Thread.java:919) 
2022-10-20 00:20:41.031 18250-18299/com.argz.issue4176 E/AndroidRuntime: FATAL EXCEPTION: Thread-3
    Process: com.argz.issue4176, PID: 18250
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/datatransport/runtime/ForcedSender;
        at com.google.firebase.crashlytics.internal.send.ReportQueue.lambda$flushScheduledReportsIfAble$0$com-google-firebase-crashlytics-internal-send-ReportQueue(ReportQueue.java:128)
        at com.google.firebase.crashlytics.internal.send.ReportQueue$$ExternalSyntheticLambda1.run(Unknown Source:4)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.datatransport.runtime.ForcedSender" on path: DexPathList[[zip file "/data/app/com.argz.issue4176-ilDe3NXyM92FVsLK9q1V1A==/base.apk"],nativeLibraryDirectories=[/data/app/com.argz.issue4176-ilDe3NXyM92FVsLK9q1V1A==/lib/x86, /system/lib, /system/product/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at com.google.firebase.crashlytics.internal.send.ReportQueue.lambda$flushScheduledReportsIfAble$0$com-google-firebase-crashlytics-internal-send-ReportQueue(ReportQueue.java:128) 
        at com.google.firebase.crashlytics.internal.send.ReportQueue$$ExternalSyntheticLambda1.run(Unknown Source:4) 
        at java.lang.Thread.run(Thread.java:919) 
2022-10-20 00:20:43.011 18250-18294/com.argz.issue4176 E/FirebaseCrashlytics: Cannot send reports. Timed out while fetching settings.
@argzdev argzdev added the type: bug Something isn't working label Oct 19, 2022
@mrichards
Copy link
Contributor

mrichards commented Oct 19, 2022

@c0ff33-b34n Thanks for reporting this, version 18.3.0 of the Crashlytics Android SDK specifies an outdated version of a dependency. (You will see the same issue if you use the BoM.)

UPDATES:

  • Fixes for firebase-crashlytics and firebase-crashlytics-ndk are now available, in version 18.3.1 for both artifacts.
  • The Firebase BoM has been updated with the fix, in version 31.0.1.
  • The firebase_crashlytics Flutter plugin has been updated with the fix, in version 3.0.2.
  • The Firebase Unity SDK has been updated with the fix, in version 10.0.1.

We're working on a fix now. In the meantime, you can either use the prior version of Crashlytics (18.2.13), or explicitly declare the missing dependency in your app's build.gradle dependencies block:

dependencies {
   implementation "com.google.firebase:firebase-crashlytics:18.3.0"
   implementation "com.google.firebase:firebase-datatransport:18.1.7"
   // ...
}
@mrichards
Copy link
Contributor

We will be shipping a new version of Crashlytics that references the correct dependencies shortly. I'll post here when we do.

To summarize the impact: The original crash report should make it through to the Crashlytics servers. The NoClassDefFoundError typically occurs in the background so it will not generally be noticeable to the end-user, though there may be circumstances where customers experience a subsequent crash due to this issue.

@CodeMasterYi
Copy link

Long for new release!

@PhilippNowak96
Copy link

Could you please update the alert message in the firebase console? Currently it looks like

image

I guess 18.30.0 should be 18.3.0, right?

@argzdev
Copy link
Contributor

argzdev commented Oct 20, 2022

Nice catch, @PhilippNowak96. I'll inform our tech writers right away. Thanks for this!

@dunghn94
Copy link

I am using Unity Crashlytics 9.5.0 Which lower should use?

@RoarGronmo
Copy link

RoarGronmo commented Oct 20, 2022

This message was published for those who use firebase-bom to achieve crashlythics.

image

@mrichards
Copy link
Contributor

@dunghn94 You are fine with Unity Crashlytics 9.5.0. For the Firebase Unity SDK, the issue is only in version 10.0.0. A fix will be out ASAP, likely 10.0.1.

@DjordjeMancic97
Copy link

which Flutter Crashlytics plugin version is safe to use?

@mrichards
Copy link
Contributor

mrichards commented Oct 20, 2022

@DjordjeMancic97 Good versions are listed here. Crashlytics Flutter plugin 2.8.13 is safe to use.

@mrichards mrichards pinned this issue Oct 20, 2022
@mrichards
Copy link
Contributor

firebase-crashlytics and firebase-crashlytics-ndk v18.3.1 are now available via our Maven repository, which fix the issue.

This comment will be updated with recommended versions for the BoM, Unity, and Flutter SDKs as fixes are released.

@mrichards
Copy link
Contributor

BoM 31.0.1 is now available, so Crashlytics Android SDK customers using the BoM can take the newest version instead of rolling back.

@alexkeramidas
Copy link

alexkeramidas commented Oct 20, 2022

Sorry to invade the thread but does not the BOM get retrieved from the firebase core settings.gradle file?

https://firebase.google.com/support/release-notes/android

FirebaseSDKVersion=30.5.0

For Flutter firebase_core versions less than 2.0.0, the bom stands at 30.0.5 (so not the faulty BOM)
If so, using any compatible Flutter firebase_crashlytics version should work, as long as you don't use version 2.0.0 of Flutter firebase_core.

Am I missing something?

@mrichards
Copy link
Contributor

@alexkeramidas Yes, only the latest version (as of right now) of the Flutter plugin is problematic; the older versions are fine.

@mrichards mrichards self-assigned this Oct 20, 2022
@alexkeramidas
Copy link

My question comes from the suggestion here...

#4223 (comment)

It says that flutter firebase_crashlytics should revert to 2.8.13.

Based on your last answer I assume using all 2.. (like 2.8.12, 2.8.13, 2.9.0) versions of flutter firebase_crashlytics that do not require version 2.0.0 of the flutter firebase_core is OK, as long as firebase_core is not on 2.0.0.

Thanks in advance for the answer.

@mrober
Copy link
Contributor

mrober commented Oct 20, 2022

@alexkeramidas For more context, the issue is specifically in Android Crashlytics 18.3.0, which Flutter firebase_crashlytics 2.9.0 depends on. It is independent of firebase_core. You can safely use 2.8.13, or any version other than 2.9.0, and no need to pin firebase_core.

@c0ff33-b34n
Copy link
Author

@mrichards I've updated and tested with com.google.firebase:firebase-crashlytics:18.3.1 and can confirm that it resolves the issue when using Crashlytics Android.

Gradle now pulls in the External Library com.google.android.datatransport:transport-runtime:3.1.8@aar containing ForcedSender.

I ran my app. Forced a crash and reloaded the app. The app no longer crashes on re-load. The crash was also received correctly in the Firebase console.

Thanks for the fast response to this issue.

@RoarGronmo
Copy link

Flutter crashlythics has been updated, unknown if it addresses this one though....

image

@mrichards
Copy link
Contributor

mrichards commented Oct 20, 2022

@RoarGronmo Yes, the fixed Flutter SDK was released a little while ago!

We've validated it, so we now recommend everyone update to firebase_crashlytics 3.0.2.

CC: @DjordjeMancic97, @alexkeramidas

@alexkeramidas
Copy link

Thanks for the prompt response and fix. Good stuff.

Regarding the subject I pointed out.

@mrober
Just by checking the gradle files of the flutter plugins:

Since the following commit from April 2022 it's indicated that there is no strict dependency of the flutter firebase_crashlytics plugin to the Android Crashlytics.

firebase/flutterfire@72158aa

It seems to depend entirely on the BOM version declared in the flutter firebase_core.

I would be very surprised if any version of firebase_core other than 2.0.0 produces the mentioned issue.

And since flutter firebase_crashlytics 2.9.0 is not compatible with 2.0.0 (it requires firebase_core: ^1.10.0) I don't expect it to cause the mentioned issue.

It seem that 2.18.3 is not any different in terms of dependencies.

The version analysis comes from here

https://firebase.google.com/support/release-notes/android

BOM 30.5.0 uses Android Crashlytics 18.2.13 (firebase_core 1.23.0 up to 1.24.0)
BOM 31.0.0 uses Android Crashlytics 18.3.0 => faulty (firebase_core 2.0.0)
BOM 31.0.1 uses Android Crashlytics 18.3.1 (firebase_core 2.1.0)

BTW
I only stumbled upon the mentioned issue by using
flutter firebase_core 2.0.0
flutter firebase_crashlytics 3.0.1

Any other combination with firebase_core 2.0.0 would either not even execute a pub get or would work normally.

Sorry if I am drilling this too much but the numbers don't add up in my head, or I am just too tired.

@mrichards
Copy link
Contributor

Firebase Unity 10.0.1 is now available, which resolves this issue. Crashlytics Unity customers should update to this version.

@RoarGronmo
Copy link

Mvn repository site hasn't updated its info yet, but 31.0.1 seems to be available anyway.

image

@G00fY2
Copy link

G00fY2 commented Oct 21, 2022

@RoarGronmo if you want to check availability go to Google's Maven: https://maven.google.com/web/m_index.html#com.google.firebase:firebase-bom

mvnrepository.com just gathers the data from the repos and is sometimes delayed.

@MoustafaElsaghier
Copy link

after updating to BOM version 31.0.1 I'm getting error messages

  • Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.google.firebase:firebase-appindexing:.

any updates, please?

@thatfiredev
Copy link
Member

@MoustafaElsaghier Your error seems unrelated to the original issue reported here. However, can you please show your build.gradle (app) file? Do you use appindexing in your app at all?

@MoustafaElsaghier
Copy link

@thatfiredev yes, I'm using appindexing and depending on BOM, and no issues with BOM version 30.3.0 but once update to 31.0.1 I get the error

@argzdev
Copy link
Contributor

argzdev commented Oct 24, 2022

Hi @MoustafaElsaghier, BoM version 31.0.1 no longer contains firebase-appindexing, firebase-core, and firebase-iid. For firebase-appindexing, it is recommended to use the one of the following options in our documentations.

@MoustafaElsaghier
Copy link

@argzdev thank you for your update

@AkashNair2
Copy link

after updating to BOM version 31.0.1 I'm getting error messages

  • Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.google.firebase:firebase-appindexing:.

any updates, please?

Did you fix your issue? I removed firebase-appindexing but still not able to run the app!
Any help, Please?

@argzdev
Copy link
Contributor

argzdev commented Oct 28, 2022

Hi @AkashNair2, you might have a different issue compared to MoustafaElsaghier. That said, could you open a new ticket using our template? The details you provide in our template will help us a lot when investigating your issue.

@AkashNair2
Copy link

@argzdev There were few references of Indexing hidden in code, Removed that.
Thanks for your time and inputs!

@MoustafaElsaghier
Copy link

Sorry for late response.
Yes it's resolved just added specific versions for app indexing

@worm69
Copy link

worm69 commented Nov 8, 2022

Any one can tell me why firebase-core got remove? Its safe migrate?
image

@thatfiredev
Copy link
Member

@worm69 firebase-core is just an alias for firebase-analytics.

If you use Google Analytics for Firebase or any other product that relies on it (A/B Testing for example). You can replace firebase-core with firebase-analytics.
If you don't use Analytics at all, feel free to remove firebase-core.

@firebase firebase locked and limited conversation to collaborators Nov 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: crashlytics type: bug Something isn't working