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

The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher. #941

Open
Abhiabhi07 opened this issue Apr 1, 2024 · 4 comments

Comments

@Abhiabhi07
Copy link

Abhiabhi07 commented Apr 1, 2024

Hi, as title describes to updrage my kotlin version iam not getting in which file to upgrade my kotlin version. tried sevral methods by updating version but didnt work any so please say me where i need to increase my org.jetbrains.kotlin:kotlin-gradle-plugin version. below are my build.gradle file and app/build.gradle file from vscode, please go through it and say the what need to be done.

===============
build.gradle

allprojects {
repositories {
google()
mavenCentral()
}
}

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

tasks.register("clean", Delete) {
delete rootProject.buildDir
}

=================

app/build.gradle file

plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

android {
namespace "com.example.ambuvians"
compileSdk 34
ndkVersion flutter.ndkVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = '1.8'
}

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.ambuvians"
    // You can update the following values to match your application needs.
    // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
    minSdkVersion 21
    targetSdkVersion 34
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.debug
    }
}

}

flutter {
source '../..'
}

dependencies {
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
implementation 'com.mapbox.maps:android:11.2.2'
}
please what would be the issue please let me know

@bartekpacia
Copy link
Collaborator

@priyankabambharoliya-official
Copy link

priyankabambharoliya-official commented Apr 8, 2024

having the same issue in location: ^6.0.1
I have added the below code to my build.gradle file

buildscript {
ext.kotlin_version = '1.9.23'
repositories {
    google()
    mavenCentral()
}

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

and update the distribution URL to this
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip

still getting the same error to update the kotlin version

@hitarthparmar0412
Copy link

hitarthparmar0412 commented Apr 22, 2024

`buildscript {
ext.kotlin_version = '1.9.23'
repositories {
google()
mavenCentral()
}

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

}

}`

I got an error

The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ': location' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20

@K-Mose
Copy link

K-Mose commented Jul 9, 2024

If you don't solved it, check this answer.
https://stackoverflow.com/a/78080295/23611846

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

5 participants