vdeomakerz '
vdeomakerz '

Reputation: 99

Supertypes of the following classes cannot be resolved

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

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

and this

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

Compilation error. See log for more details

this is my app module

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'

and my project gradle is this

// 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
}

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

Upvotes: 5

Views: 21017

Answers (7)

Pampapathi
Pampapathi

Reputation: 347

If you are using firebase-bom, then you should update to latest version. For me, after upgading to latest it started working.

Lastest version as of now :

com.google.firebase:firebase-bom:24.5.0

You can check latest version HERE

Upvotes: 0

Rakesh Kumar
Rakesh Kumar

Reputation: 345

Add following in gradle:-

implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'

Upvotes: 1

Catalina
Catalina

Reputation: 2098

The other thing that may happen is that you are using implementation instead of api for one of your dependencies which may conflict with another dependency in your module.

Upvotes: 1

Devix
Devix

Reputation: 430

add this solves my problem

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

Upvotes: -2

Rishabh876
Rishabh876

Reputation: 3180

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

Upvotes: 7

sonjaBrzak
sonjaBrzak

Reputation: 41

Updating all the dependencies from the "com.google.android.gms:" group and also the firebase-messaging version to 15.0.0. instead of 12.0.1 fixed this issue for me.

Upvotes: 3

donfuxx
donfuxx

Reputation: 11323

i see at least 2 problems in your gradle file:

  1. You have a duplicated entry for "kotlin-stdlib-jre7" (one implementation and one compile). Remove the last one:

    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    
  2. Not using the latest versions of firebase & google play services: update to firebase 11.6.2

Upvotes: 1

Related Questions