Gradel Plugin wird nicht mehr unterstützt

  • Antworten:3
Robbiani Renato
  • Forum-Beiträge: 602

11.04.2023, 16:52:08 via Website

Hallo zusammen

Ich kann meine App nicht mehr ausführen. Beim Kompilieren kommt folgende Fehlermeldung.

he 'kotlin-android-extensions' Gradle plugin is no longer supported. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.

Ich bin der Meinung, dass ich das umgesetzt habe was verlangt wird

android {
compileSdkVersion 33

buildFeatures {
    viewBinding = true
}

Oder was muss ich noch machen damit es wieder geht?

Mein Build.gradle

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//plugins {
// id 'com.android.application'
// id 'kotlin-android'
//}

android {
compileSdkVersion 33

buildFeatures {
    viewBinding = true
}

defaultConfig {
    applicationId "ch.robbisoft.kassieren"
    minSdkVersion 21
    targetSdkVersion 33
    versionCode 9
    versionName '1.3.4'

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
    jvmTarget = '1.8'
}
namespace 'ch.robbisoft.kassieren'

}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

und weiter

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

buildscript {
ext.kotlin_version = "1.8.10"
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
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
}

}

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

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

In der Zeile "classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" kommt noch folgende Warnung.

Kotlin version that is used for building with Gradle (1.8.10) differs from the one bundled into the IDE plugin (1.8.0) 

Vielleicht hat das ebenfalls einen Einfluss.
Was muss ich wo ändern damit es wieder geht?

Gruss Renato

Kommentieren
Jokel
  • Forum-Beiträge: 1.527

11.04.2023, 17:30:32 via Website

Wenn es ein java Projekt ist.
Lösche dise beiden Zeilen.
implementation "org.jetbrains.kotlin:kotlin-stdlibkotlin_version"
implementation 'androidx.core:core-ktx:1.10.0'

Hatte ich auch.

Hilfreich?
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 602

11.04.2023, 17:32:43 via Website

Hallo zusammen

Möglicherweise bin ich ein Schritt weiter gekommen. Ich habe das Plugin aktiviert. Nun kann er aber das "databinging" nicht machen.

import ch.robbisoft.kassieren.databinding.ActivityMainBinding

Irgend wo muss man noch was aktivieren. Aber ich kann mich nicht mehr erinnern was.
Kann mir jemand auf die Sprünge helfen?

Gruss Renato

Hilfreich?
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 602

11.04.2023, 17:33:56 via Website

Ciao Jokel

Nein es handelt sich um ein Kotlin Projekt.

Gruss Renato

Hilfreich?
Kommentieren