Firebase无法生成FCM令牌

时间:2019-06-01 06:20:19

标签: android firebase firebase-cloud-messaging google-oauth2

重新格式化笔记本电脑并安装了最新版本的android studio之后 FCM令牌生成突然停止。 我将Firebase消息更新为18.0.0

应用程序级Build.gradle文件

android {
    compileSdkVersion 26
    buildToolsVersion '28.0.3'

    defaultConfig {
        vectorDrawables.useSupportLibrary = true
        applicationId "com.myapp.app"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 21
        versionName "1.0.21"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/notice'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license'
        exclude 'META-INF/license.txt'
    }
    dexOptions {
        javaMaxHeapSize "Xg"
//        jumboMode = true
    }
    lintOptions {
        abortOnError false
    }

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

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    //noinspection GradleCompatible
    implementation 'com.android.support:design:26.1.0'
    //noinspection OutdatedLibrary
    implementation 'com.android.volley:volley:1.0.0'
    implementation 'com.google.code.gson:gson:2.3'
    implementation 'com.android.support:multidex:1.0.1'
    implementation 'de.hdodenhof:circleimageview:1.2.1'
    implementation 'com.github.gcacace:signature-pad:1.2.1'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:appcompat-v7:26.+'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
    implementation 'com.github.bumptech.glide:glide:3.5.2'
    implementation 'com.google.android.gms:play-services-location:11.4.2'
    implementation 'com.google.android.gms:play-services-maps:11.4.2'
    implementation 'com.google.android.gms:play-services:11.4.2'
    implementation 'com.google.android.gms:play-services-gcm:11.4.2'
    implementation 'com.google.maps.android:android-maps-utils:0.5'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
    //implementation 'com.google.firebase:firebase-core:11.4.2'
    //implementation 'com.google.firebase:firebase-messaging:11.4.2'
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-messaging:18.0.0'
    implementation 'com.intuit.sdp:sdp-android:1.0.5'
    implementation 'com.shuhart.stepview:stepview:1.2.6'
    implementation 'com.xw.repo:bubbleseekbar:3.6'
    implementation 'com.github.andyxialm:ColorDialog:1.0.0'
    implementation 'com.github.twinkle942910:monthyearpicker:0.0.1'
    implementation 'com.daasuu:EasingInterpolator:1.0.0'
    implementation 'com.agrawalsuneet.androidlibs:dotsloader:1.1'
    implementation 'io.nlopez.smartlocation:library:3.3.3'
    implementation 'com.bogdwellers:pinchtozoom:0.1'
    implementation 'org.jsoup:jsoup:1.8.3'
    implementation 'com.wdullaer:materialdatetimepicker:2.3.0'
    implementation 'com.airbnb.android:lottie:2.5.0-rc1'
    implementation 'com.razorpay:checkout:1.5.5'
    implementation 'com.google.zxing:core:3.2.1'
}
apply plugin: 'com.google.gms.google-services'

项目级Build.gradle文件

buildscript {

    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:4.1.0'
        classpath 'io.fabric.tools:gradle:1.25.4'
    }
}

all projects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com" // Google's Maven repository

        }
        maven { url "https://jitpack.io" }
        //mavenCentral()
        google()
    }
}

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

出错 错误:无法访问zzbck 找不到com.google.android.gms.internal.zzbck的类文件

试图通过

对此进行更改
implementation 'com.google.android.gms:play-services-location:16.0.0' 
implementation 'com.google.android.gms:play-services-maps:16.0.0' 
implementation 'com.google.android.gms:play-services:16.0.0' 
implementation 'com.google.android.gms:play-services-gcm:16.0.0'

0 个答案:

没有答案