Olá! Não consigo rodar o programa, aparece sempre esse erro:
"Build file 'C:\Users\Ley\Desktop\revisoes e testes\Alura\Navigation1\android-navigation-projeto-inicial\app\build.gradle' line: 2
A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'kotlin-android'] The current Gradle version 5.1.1 is not compatible with the Kotlin Gradle plugin. Please use Gradle 6.1.1 or newer, or the previous version of the Kotlin plugin. "
meu gradle do app está assim:
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.android.application"
android {
compileSdk 32
defaultConfig {
applicationId "br.com.alura.aluraesporte"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
def room_version = "2.0.0"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
def koin_version = "2.0.1"
implementation "org.koin:koin-android:$koin_version"
implementation "org.koin:koin-android-viewmodel:$koin_version"
def coroutines_version = "1.1.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
def nav_version = "2.4.2"
// Kotlin
implementation("androidx.navigation:navigation-fragment-ktx:$nav_version")
implementation("androidx.navigation:navigation-ui-ktx:$nav_version")
}
e o grade do projeto está assim:
buildscript {
ext.kotlin_version = '1.3.40'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
def nav_version = "2.4.2"
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version")
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Se alguém souber como resolver eu agradeço muito!