3

I am not using kotlin in my program, it was working fine unless I update the target version from 26 to 28. I don't know a bit about kotlin. whenever i am trying to sync the gradle files it gives an error :

org.jetbrains.kotlin.gradle.KotlinGradleModel.getImplements()Ljava/util/List;

Why it is happening so ?

My gradle file is :

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.pr20020897.dms"
        minSdkVersion 21
        targetSdkVersion 28
        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 'com.android.support:appcompat-v7:28.0.0-alpha1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:design:28.0.0-alpha1'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

Project level gradle :

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

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

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

I think, there is something wrong with android studio itself because I tried to create new project but in that also i am getting the same error.

11
  • check project level build.gradle. Commented Oct 11, 2018 at 7:18
  • 1
    I would suggest not using alpha releases... 28.0.0 was released in September Commented Oct 11, 2018 at 7:19
  • @cricket_007 how kotlin related to alpha version ? Commented Oct 11, 2018 at 7:21
  • I don't know, but Android 28 isn't related to your error. It's a problem with the Gradle version, not Android. Commented Oct 11, 2018 at 7:22
  • ya, but it didn't work. Commented Oct 11, 2018 at 7:24

1 Answer 1

1

First, try to update your gradle to:

classpath 'com.android.tools.build:gradle:3.2.0'

And in your dependencies, use the stable version:

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'

Since you said you're not using kotlin, Updating the kotlin plugin will help

Go to: File -> Settings -> Plugins do update the kotlin then restart.

Sign up to request clarification or add additional context in comments.

1 Comment

Worked like a charm!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.