Fatal Exception: java.lang.NoClassDefFoundError com.google.android.gms.internal.firebase-perf.zzw

那年仲夏 提交于 2019-12-02 18:34:54

Firebase-crash version and firebase-perf version must be lesser than or equal to the Firebase-core version so In your code just change the Firebase-crash:16.0.1 version to Firebase-crash:16.0.0 and firebase-perf:16.1.0 version to firebase-perf:16.0.0 Because your's firebase-core version is 16.0.1

   compile 'com.google.firebase:firebase-perf:16.0.0'
   compile 'com.google.firebase:firebase-crash:16.0.0'

I had the same problem, although Siva Kumar's solution worked, what also worked for me was to use the latest google-services library on your project build.gradle :

dependencies {
    classpath 'com.google.gms:google-services:4.1.0'
}

For me none of the other solutions worked. Very frustrating, the application didn't even start. Finally I removed Performance Monitoring:

//apply plugin: 'com.google.firebase.firebase-perf'
//implementation 'com.google.firebase:firebase-perf:16.1.2'

My problem was solved in two steps:

  • First, I updated all my Firebase dependencies in build.gradle (app) to their latest versions. Simply update every highlighted Firebase dependency.
  • Update your google-services library on your build.gradle (project) to the latest version. You can also use the warning-highlight of android studio to guide you.

    dependencies {
        classpath 'com.google.gms:google-services:4.3.0' // this is the latest as at July, 2019
    }
    

Everything should work fine after this.

I hope this helps. Merry coding!

As per the pre-requisites documentation on Firebase - Performance Monitoring documentation about android:

Before you begin, you need a few things set up in your environment:

A device running Android 4.0 (Ice Cream Sandwich) or newer, and Google Play services 16.1.0 or higher
The Google Play services SDK from the Google Repository, available in the Android SDK Manager
The latest version of Android Studio, version 2.2 or higher

This link explains in details for the setup.

Firebase Performance Monitoring Guide

Moreover, Alex has mentioned about the way we can bring in the latest google services in build cycle by upgrading the dependency mentioned in the gradle

classpath 'com.google.gms:google-services:4.1.0'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!