以下类的超类型无法解析 [英] Supertypes of the following classes cannot be resolved

查看:154
本文介绍了以下类的超类型无法解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在kotlin中有android app,这给了我这个错误.

I have android app in kotlin which is giving me this error.

错误:以下类的超类型无法解析.请确保您在类路径中具有必需的依赖项: com.google.firebase.auth.FirebaseAuth类,未解析的超类型:com.google.android.gms.internal.aad

Error: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath: class com.google.firebase.auth.FirebaseAuth, unresolved supertypes: com.google.android.gms.internal.aad

还有这个

错误:任务':app:compileDebugKotlin'的执行失败.

Error:Execution failed for task ':app:compileDebugKotlin'.

编译错误.请参阅日志以获取更多详细信息

Compilation error. See log for more details

这是我的应用程序模块

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "appname"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

     implementation 'com.android.support:appcompat-v7:26.1.0'
     implementation 'com.android.support:animated-vector-drawable:26.1.0'
    implementation 'com.android.support:mediarouter-v7:26.1.0'
   implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'

    implementation 'com.firebaseui:firebase-ui-database:3.0.0'



    //noinspection GradleCompatible,GradleCompatible
    implementation 'com.google.android.gms:play-services:11.0.4'
    implementation 'com.google.firebase:firebase-auth:11.0.4'
    implementation 'com.google.firebase:firebase-database:11.0.4'
    implementation 'com.google.firebase:firebase-storage:11.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

}

 repositories {
    mavenCentral()
}
apply plugin: 'com.google.gms.google-services'

我的项目成果是这个

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

buildscript {
    ext.kotlin_version = '1.1.51'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        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
        classpath 'com.google.gms:google-services:3.1.0'

    }
}

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

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

我有firebase.auth implementation,但是仍然向我显示错误.

I have firebase.auth implementation but still, it's showing me the error.

推荐答案

com.firebaseui:firebase-ui-auth更新为3.3.1对其进行了修复.由于较旧的版本(本例中为3.1.0)与com.google.firebase:firebase-messaging v15

Updating com.firebaseui:firebase-ui-auth to 3.3.1 fixed it for me. As the older versions (3.1.0 in my case) was not compatible with com.google.firebase:firebase-messaging v15

这篇关于以下类的超类型无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆