E / AndroidRuntime: ФАТАЛЬНОЕ ИСКЛЮЧЕНИЕ: Firebase-MyFirebaseMessagingService Android Studio - PullRequest
0 голосов
/ 29 сентября 2018

Мое приложение аварийно завершает работу, когда оно пытается получить уведомление из облачной службы Firebase.

Вот журнал ошибок:

E/AndroidRuntime: FATAL EXCEPTION: Firebase-MyFirebaseMessagingService
                  Process: com.seesharp.taxibyeuser, PID: 31273
                  java.lang.NoSuchMethodError: No static method zzc(Landroid/content/Context;)Lcom/google/firebase/iid/zzs; in class Lcom/google/firebase/iid/zzs; or its super classes (declaration of 'com.google.firebase.iid.zzs' appears in /data/app/com.seesharp.taxibyeuser-Kx-umRNM53Ly-ccAR442PQ==/split_lib_dependencies_apk.apk)
                      at com.google.firebase.messaging.FirebaseMessagingService.zzd(Unknown Source:117)
                      at com.google.firebase.iid.zzg.run(Unknown Source:26)
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                      at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:7)
                      at java.lang.Thread.run(Thread.java:764)

Я искал в google и stackoverflow, но всерешения бесполезны.Однако во время поиска я обнаружил, что проблема связана с моим build.gradle, но я не знаю, в чем проблема и как ее исправить.

Вот содержимое приложения build.gradle:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }




}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}





android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.seesharp.taxibyeuser"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 9
        versionName "1.9"
        multiDexEnabled true
        testInstrumentationRunner "android.support.home_fragment.runner.AndroidJUnitRunner"
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath true
            }
        }
    }
    dexOptions {
        preDexLibraries = false
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

dependencies {
    implementation ('com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.13.0') {
        transitive = true
    }
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.13.0'
    implementation 'com.google.firebase:firebase-auth:15.1.0'
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.paypal.sdk:paypal-android-sdk:2.15.3'
    implementation 'com.github.TheBrownArrow:PermissionManager:1.0.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'gun0912.ted:tedbottompicker:1.1.0'
    implementation 'com.akexorcist:googledirectionlibrary:1.0.5'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.google.android.gms:play-services-places:15.0.1'
    implementation 'com.google.android.gms:play-services-base:15.0.1'
    implementation 'com.google.firebase:firebase-database:15.0.1'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation ('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
        transitive = true;
    }

}

apply plugin: 'com.google.gms.google-services'

и вот проект build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
        classpath 'com.google.gms:google-services:3.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://jitpack.io' }
        maven {
            url 'https://maven.google.com'
        }
        google()
    }
}

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

Если вам нужна дополнительная информация о проекте, просто скажите, что вы хотите от меня опубликовать.

Пожалуйста, мне нужно, чтобы это сработало.

1 Ответ

0 голосов
/ 29 сентября 2018

java.lang. NoSuchMethodError : Нет статического метода zzc (Landroid / content / Context;) Lcom / google / firebase / iid /zzs

Попробуйте обновить до последней версии Firebase:

implementation 'com.google.firebase:firebase-core:16.0.3'
...
..

Службы Google:

classpath 'com.google.gms:google-services:4.1.0'

Кроме того, версии, которые вы используете дляпожарная база должна быть как минимум такой же.Например:

implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.3'   

Существует всего несколько зависимостей, которые могут иметь разные версии.Например:

implementation 'com.google.firebase:firebase-messaging:17.3.0'

Проверьте и прочитайте: https://firebase.google.com/docs/android/setup#available_libraries

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...