Firebase messaging NoSuchMethodError.zzUr exception

前端 未结 4 1896
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 12:25

i am trying to integrate FCM to android project as it\'s written in Firebase documentation.

My app\'s gradle:

dependencies {
compile fileTree(include         


        
相关标签:
4条回答
  • 2020-11-29 12:30

    I have face same problem and resolve this issue by configuring proguard rules properly.

    What I did here under as below:

    First I have excluded google classes from obfuscating like this in proguard-rules.pro:

    -keep public class com.google.** {*;}
    

    Second I have enabled this minifyEnabled in build.gradle like this:

        apply plugin: 'com.android.application'
    
        android {
        compileSdkVersion 23
        buildToolsVersion "23.0.3"
    
        defaultConfig {
            applicationId "com.e2e.quiz"
            minSdkVersion 15
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        }
    
        dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.squareup.picasso:picasso:2.4.0'
    compile 'com.google.android.gms:play-services-gcm:9.2.1'
    compile 'com.google.android.gms:play-services-analytics:9.2.1'
    compile 'com.google.android.gms:play-services-ads:9.2.1'
    compile project(':ast-dst')
    

    }

    0 讨论(0)
  • 2020-11-29 12:31

    Try running all services with the same version. In this case, change:

    compile 'com.google.firebase:firebase-messaging:9.0.2'
    

    to

    compile 'com.google.firebase:firebase-messaging:9.2.0'
    

    and check if the same issue happens.

    0 讨论(0)
  • 2020-11-29 12:46

    Change the versions of firebase1 It works to me!

    The versions must be the same:

    compile 'com.google.firebase:firebase-analytics:9.2.0'
    compile 'com.google.firebase:firebase-messaging:9.2.0'
    compile 'com.google.firebase:firebase-core:9.2.0'
    
    0 讨论(0)
  • 2020-11-29 12:47

    keep the same version of the firebase-core library and firebase-messaging library by Changing the firebase-messaging library version in build gradle

    from:

    compile 'com.google.firebase:firebase-core:9.2.0'
    compile 'com.google.firebase:firebase-messaging:9.0.2
    

    to:

    compile 'com.google.firebase:firebase-core:9.2.0'
    compile 'com.google.firebase:firebase-messaging:9.2.0'
    
    0 讨论(0)
提交回复
热议问题