android - 无法为抽象类 'GoogleServicesTask' 创建代理类。与 'com.google.gms:google-services:4.3.4'

标签 android firebase crashlytics

昨晚将 Fabrics crashlytics 升级到 Firebase。
当我尝试重建应用程序时,它遇到了很多问题,我一一修复了这些问题,但最后一个问题被卡住了:

Cannot create a proxy class for abstract class 'GoogleServicesTask'


应用程序/构建
buildscript {
    ext.kotlin_version = '1.3.41'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.3.4'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
在我的 app/gradle 文件中,我有
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.xxx.xxxx"
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 23
        versionName "1.1.2"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            firebaseCrashlytics {
                mappingFileUploadEnabled false
            }
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
}
dependencies { my all dependencies}
apply plugin: 'com.google.gms.google-services'

最佳答案

更好地更新这个过时的 Android Gradle 插件:

classpath "com.android.tools.build:gradle:3.4.2"
到与 Android Studio 版本相匹配的版本...
classpath "com.android.tools.build:gradle:7.0.2"

关于android - 无法为抽象类 'GoogleServicesTask' 创建代理类。与 'com.google.gms:google-services:4.3.4',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64201624/

相关文章:

android - Google Play 无法销售应用

android - 如何解决 Android SQLite 舍入错误

ios - 如何将模型数据对象添加到 Firebase 数据库

java - 安卓 Java : Error when submit form(post) on Webview

java - Android - 多个 Activity 使用一个类

android - 在某些设备上关闭应用程序时,Firebase 推送通知不起作用

android - Android 手机上的延迟推送通知

android - 如何从 APK 反编译中保护 Fabric API key ?

android - java.lang.IllegalStateException : SharedPreferences in credential encrypted storage are not available until after user is unlocked

crashlytics - Android Fabric Crashlytics 在应用程序启动时因 Resources$NotFoundException 崩溃