NoClassDefFoundError on com.google.android.gms.internal.firebase-perf.zzw
Asked Answered
A

2

21

Received numbers of crash report from Firebase Crashlytics. It is related to firebase-perf I think.

Fatal Exception: java.lang.NoClassDefFoundError: com.google.android.gms.internal.firebase-perf.zzw
   at com.google.firebase.perf.metrics.Trace.start(Unknown Source:44)
   at com.google.android.gms.internal.firebase-perf.zze.onActivityStarted(Unknown Source:48)
   at android.app.Application.dispatchActivityStarted(Application.java:205)
   at android.app.Activity.onStart(Activity.java:1150)

Already using the newest version of Firebase and Google Play Services.

It does not crash on devices in Firebase Test Lab. But ~1% of user facing this problem.

Is it related to absent of GMS Core? If so, how to handle it properly, not causing crash on those devices?

--- Update ---

project build.gradle

buildscript {
    repositories {
        google()
        maven {
            url 'https://maven.fabric.io/public'
        }
        jcenter()

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0-alpha04'
        classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
        classpath 'io.fabric.tools:gradle:1.25.4'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

App build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.2'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "MASKED"
        minSdkVersion 18
        targetSdkVersion 28
        versionCode "MASKED"
        versionName "MASKED"
        resConfigs "en"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        dataBinding {
            enabled = true
        }
    }


    buildTypes {
        release {
            minifyEnabled true
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    lintOptions {
        abortOnError false
        textReport true
        textOutput 'stdout'
        checkReleaseBuilds false

    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0-rc01'
    implementation 'androidx.annotation:annotation:1.0.0-rc01'
    implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
    implementation 'androidx.leanback:leanback:1.0.0-rc01'
    implementation 'androidx.cardview:cardview:1.0.0-rc01'
    implementation 'androidx.gridlayout:gridlayout:1.0.0-rc01'
    implementation 'androidx.multidex:multidex:2.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.2'

    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.firebase:firebase-config:16.0.0'
    implementation 'com.google.firebase:firebase-perf:16.0.0'

    implementation 'com.google.android.material:material:1.0.0-rc01'
    implementation 'com.google.android.gms:play-services-oss-licenses:16.0.0'
    implementation 'com.google.android:flexbox:1.0.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'

}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
Ariana answered 20/8, 2018 at 15:6 Comment(11)
Please add the content for both of your build.gradle files.Etem
What is the API level of the devices on which the exception occurs? I am seeing this problem on API 28.Matheson
Different API level facing this problem. From Android 5.1.1 to Android 8. But mostly Android 6.Ariana
It's happening for me as well.Skeie
Hello! I'm from the Firebase Performance Monitoring team. I have a couple questions to help us figure out where this bug is. 1. Do you see this problem when running on android studio or on production apps via crashlytics? 2. If it's crashlytics, do you use Android App Bundles (developer.android.com/platform/technology/app-bundle)Ulcerous
@Ulcerous 1. I cannot reproduce it in my env. Those error are received from Crashlytics. 2. Both APK and AAB release will have similar crash report.Ariana
@mike_haney: I was seeing the problem both with release builds (via Crashlytics) and debug builds. I don't use App Bundles. The problem resolved after I upgraded Android Studio to use Android Gradle Plugin 3.3.0-alpha08 and also upgraded to the Aug 23 release of the Firebase SDK. I also disabled R8 with android.enableR8=false and used Proguard for minification of release builds. Not sure if all these changes were needed.Matheson
@Ulcerous We're suffering from the same crashesIntercommunion
@Ulcerous I am getting crashes from both Production and debug, it happens every-time I open the app. It started when I updated com.google.firebase:firebase-perf:16.1.0 I am rolling back to 16.0.0. The stacktrace points at a line that has a logEvent method from FirebaseAnalytics and in debug build says that I have not called FirebaseApp.initializeApp(this) even if I explicitly called from my Application class.Olympium
@Ulcerous I have a device in hands and I can reproduce the error on it with all of my appsMoonstruck
Be sure to let @Tejas know in the below answer, he's the engineer resolving these issuesUlcerous
S
9

Firebase support has just confirmed me this is a bug. They are working on this right now (although they weren't able to reproduce it yet). So we should expect this to be fixed in a future Firebase release.

Skeie answered 22/8, 2018 at 13:25 Comment(6)
Did Firebase Support suggest anything to work around the problem? I haven't been able to figure out what library or tool downgrade I need to do to get back to a working configuration.Matheson
They didn't say. I'll ask.Skeie
after I've upgraded com.google.firebase:firebase-perf to 16.1.0 my users started experiencing crashes as well, just gonna roll back to 16.0.0Shivaree
@Skeie Can we get a link to the bug report?Baryton
@MinasMina There's no bug report. I had a conversation with Firebase support. They confirmed the issue but they could not reproduce it. Yesterday I got the last email saying that as they still can't reproduce it locally they will close my report and "monitor" the situation. (?)Skeie
I am facing the very same thing. The version is 16.1.0. To reproduce, launch the app and wait 30 minutes. The app will never be launched again.Moonstruck
N
6

Update: Please update to Firebase Performance Version 16.2.5 to solve this issue.

Niels answered 4/9, 2018 at 14:56 Comment(17)
Build a new version without Multidex. Let see if it help. BTW, Multidex w/ AndroidX is having a much slower cold starts......Ariana
@Skeie Did you face problem 1 or problem 2?Niels
Update: Issue seems gone after removing multidex.Ariana
@Niels Problem 1. I got lots of crashes in Crashlytics in my app (no multidex) untill I downgraded firebase-perf.Skeie
@Skeie Can you share device/OS combos that this crash happens on?Niels
@Niels Yes... -- Moto G (2nd gen) - Android 6.0 ; Galaxy Note 4 - Android 6.0.1 ; Galaxy S5 mini - Android 6.0.1 ; Galaxy S5 Neo - Android 6.0.1 -- I thought there were non Android 6 errors, but I can't find them now.Skeie
We're seeing lots of the NoClassDefFoundError in Crashlytics and Play crash reports, so far across Android 5 and 6 versions. @Tejas, we tried a proguard change (github.com/opendatakit/collect/pull/2548/files) and that didn't help. The project is open source if that can help (github.com/opendatakit/collect/issues/2542). Can't reproduce locally so disabling the lib for now.Jesusitajet
Device manufacturers: 33% samsung, 23% Xiaomi, 20% LENOVO, 17% ZTE 7% Other. Also seeing a Huawei in a different report of the same crash (seems it can happen from different activities) so I don't think it's related to device.Jesusitajet
I can reproduce the error!!! I have a device in my hands right now and I can reproduce it wherever I wantMoonstruck
@Niels Has this been fixed? There's a 16.1.2 release, but no release notes has been posted. Should I upgrade? Thanks.Skeie
@niqueco. No it is not fixed. I can reproduce the error on version 16.1.2 as wellMoonstruck
@everyone - Please try using version 16.2.0 of the firebase performance SDK - we've added a potential fix to it. Thanks!Niels
@Niels This still occurs on 16.2.0. Using com.google.firebase:firebase-plugins:1.1.5Vault
@LukeBrandonFarrell Would you be able to share the stacktrace of the issue? (Ideally uploaded to a github gist or a pastebin)Niels
@Niels any update on this bug? Looks like we're now on 16.2.3 of firebase-perf. Have there been any fixes?Phthalocyanine
We've identified the problem and are working on a fix - I'll update the answer once we're able to ship it!Niels
@Phthalocyanine Please update to version 16.2.4 of firebase performance to fix this issue.Niels

© 2022 - 2024 — McMap. All rights reserved.