错误:无法解析以下类的超类型.请确保您在classpath& quot;中具有必需的依赖项. [英] "Error: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath"

查看:115
本文介绍了错误:无法解析以下类的超类型.请确保您在classpath& quot;中具有必需的依赖项.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Android项目(Kotlin)无法编译.

My Android project (Kotlin) doesn't compile.

成绩日志:

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

这是我的应用Gradle:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.arturpoplawski.bandmanager"
        minSdkVersion 24
        targetSdkVersion 27
        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'])

    //kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

    //android
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'

    //firebase
    implementation 'com.google.firebase:firebase-firestore:11.8.0'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
    implementation 'com.google.firebase:firebase-auth:11.2.2'

    //picasso
    implementation 'com.squareup.picasso:picasso:2.71828'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

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

这是项目Build Gradle:

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

buildscript {
    ext.kotlin_version = '1.2.30'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        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:4.0.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

推荐答案

要解决此问题,请更改以下代码行:

To solve this, please change the following lines of code:

implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
implementation 'com.google.firebase:firebase-auth:11.2.2'

implementation 'com.google.firebase:firebase-firestore:17.0.4'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.2'

此外,我认为这行代码是不完整的:

Also, I see this line of code to be partial:

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

正确的整行应为:

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

这篇关于错误:无法解析以下类的超类型.请确保您在classpath& quot;中具有必需的依赖项.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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