Getting Exception java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions after updating to the new firebase

后端 未结 15 1662
渐次进展
渐次进展 2020-11-22 09:56

I have updated my application to the new firebase using the this and now when i compile my project i get the following exception.

Here is my logcat:

15条回答
  •  轮回少年
    2020-11-22 10:19

    I think I've found a solution for this issue at this answer, please give it a look and thank @Gabriele Mariotti, he wrote:

    In your top-level build.gradle you have to add:

    buildscript {
        // ...
        dependencies {
            // ...
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    

    Then in your module build.gradle:

    apply plugin: 'com.android.application'
    
    android {
      // ...
    }
    
    dependencies {
      // ... 
    
    }
    
    // ADD THIS AT THE BOTTOM
    apply plugin: 'com.google.gms.google-services'
    

提交回复
热议问题