Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Kotlin Gradle plugin version #3

Open
dekdoijaidee opened this issue Jan 19, 2020 · 12 comments
Open

Error: Kotlin Gradle plugin version #3

dekdoijaidee opened this issue Jan 19, 2020 · 12 comments

Comments

@dekdoijaidee
Copy link

Hi

I use your lib and found error when build my app

FAILURE: Build failed with an exception.

  • What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
    The following dependencies do not satisfy the required version:
    project ':flutter_rtmp_publisher' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.0

What should I do?

Thank you

@TejaDroid
Copy link

You have to degrade your Kotlin Gradle Version : 1.3.0, because flutter_rtmp_publisher using gradle version of 1.3.0.

@Vercjames
Copy link

Howdy! forgive me but I must be missing something because just changing build.gradle ext.kotlin_version = '1.3.50' to "1.3.0" doesn't fix the issue. Can you please be more specific on how to downgrade property. Thanks.

I tried a flutter clean but still got the same error

  • What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
    The following dependencies do not satisfy the required version:
    root project 'android' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.0

@Vercjames
Copy link

resolved, changing minSdkVersion 16 to 21 and copying this packages Buildscript worked.

@selvakumardreams
Copy link

@Vercjames , I too have the same issue. I have changed minSdkVersion 16 to 21. Still, I am getting the error. Could you detail copying these packages build scripts mean?

@Vercjames
Copy link

Vercjames commented Apr 21, 2020

Hit me up with the error message you are getting. Additionally after changing the 16 to 21 and then downgrading the Grable Version, I ran a Flutter Clean.

android/build.gradle

buildscript {
    ext.kotlin_version = '1.3.0'
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

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

@selvakumardreams
Copy link

Thanks @Vercjames its resolved

@abheet-98
Copy link

@Vercjames my issue is not getting resolved by doing these three things

Hit me up with the error message you are getting. Additionally after changing the 16 to 21 and then downgrading the Grable Version, I ran a Flutter Clean.

android/build.gradle

buildscript {
    ext.kotlin_version = '1.3.0'
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

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

Could u explain me in some detail?

@Vercjames
Copy link

Can you provide me some context kind sir. an error message perhaps. I assume you are trying to set this all up in a new flutter project. Also I used windows to compile my application, if you are MacOS something may be different with the pod installation.

@abheet-98
Copy link

@Vercjames
Yes I'm trying this all in a new flutter project and working on windows.
The error message is same:
FAILURE: Build failed with an exception.

  • What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
    The following dependencies do not satisfy the required version:
    project ':flutter_rtmp_publisher' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.0

I have set minsdk in app build.gradle to 21 and done flutter clean as well.
If u could help me with how to downgrade the gradle version that will suffice I think.

@Vercjames
Copy link

Peculiar - since the provided script should have downgraded gradle for you. but rather than leaving you hanging I made a video to hopefully put this thread to bed. hopefully this solves the issue.

https://www.youtube.com/watch?v=3fVS8dVMftY

@abheet-98
Copy link

@Vercjames
Thank you for the video but now there are more issues arising.
Actually I'm also using the camera plugin which I think is giving error.

**FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:preDebugBuild'.

Android dependency 'androidx.lifecycle:lifecycle-runtime' has different version for the compile (2.0.0-rc01) and runtime (2.0.0) classpath. You should manually set the same version via DependencyResolution

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 32s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 33.6s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the
incompatibility.
Building plugin camera...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 4.4s

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'camera'.

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s

The plugin camera could not be built due to the issue above.**

@odejinmi
Copy link

Hit me up with the error message you are getting. Additionally after changing the 16 to 21 and then downgrading the Grable Version, I ran a Flutter Clean.

android/build.gradle

buildscript {
    ext.kotlin_version = '1.3.0'
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

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

after downgrading this the error I'm having

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/user/StudioProjects/startv/android/app/build.gradle' line: 25

  • What went wrong:
    A problem occurred evaluating project ':app'.

java.lang.ExceptionInInitializerError (no error message)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants