2

Hey guys how can I update to latest version because I cannot find the latest gradle-plugin. Can somone guide me on this?

build.gradle(:app)

plugins {
    id "com.android.application"
    id "org.jetbrains.kotlin.android"
}

android {
    namespace "com.abc.xyz"
    compileSdk 34

    defaultConfig {
        applicationId "com.abc.xyz"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary true
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion compose_compiler_version
    }
    packagingOptions {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
}

dependencies {

    def composeBom = platform "androidx.compose:compose-bom:$compose_bom"
    implementation composeBom
    androidTestImplementation composeBom

    implementation("androidx.core:core-ktx:1.10.1")
    implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")

    implementation("androidx.compose.ui:ui")
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.foundation:foundation-layout")
    implementation("androidx.compose.material:material")
    implementation("androidx.compose.material3:material3")
    implementation("androidx.compose.runtime:runtime")
    implementation("androidx.compose.runtime:runtime-livedata")
    implementation("androidx.compose.ui:ui-tooling")
    implementation("androidx.compose.ui:ui-tooling-preview")
    implementation("androidx.lifecycle:lifecycle-viewmodel-compose")
    implementation("androidx.activity:activity-compose:$compose_activity")

    implementation("androidx.navigation:navigation-compose:$nav_version")

    implementation("io.insert-koin:koin-android:$koin_android_version")
    implementation ("io.insert-koin:koin-androidx-compose:$koin_android_compose_version")

    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
    androidTestImplementation("androidx.compose.ui:ui-test-junit4")
    debugImplementation("androidx.compose.ui:ui-tooling")
    debugImplementation("androidx.compose.ui:ui-test-manifest")
}

build.gradle(ExampleApp)

buildscript {
    ext {
        compose_compiler_version = "1.5.1"
        compose_activity = "1.7.2"
        compose_bom = "2023.06.01"
        koin_android_version = "3.4.0"
        koin_android_compose_version = "3.4.3"
        nav_version = "2.6.0"
    }
}

plugins {
    id "com.android.application" version '8.1.0' apply false
    id "com.android.library" version '8.1.0' apply false
    id "org.jetbrains.kotlin.android" version "1.9.0" apply false
}

gradle-wrapper.properties

#Fri Mar 17 15:27:20 GMT 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

Getting this warning message, I updated already everything what I am missing can somone tell me?

We recommend using a newer Android Gradle plugin to use compileSdk = 34
    
    This Android Gradle plugin (8.1.0) was tested up to compileSdk = 33 (and compileSdkPreview = "UpsideDownCakePrivacySandbox").
    
    You are strongly encouraged to update your project to use a newer
    Android Gradle plugin that has been tested with compileSdk = 34.
    
    If you are already using the latest version of the Android Gradle plugin,
    you may need to wait until a newer version with support for compileSdk = 34 is available.
    
    To suppress this warning, add/update
        android.suppressUnsupportedCompileSdk=34
    to this project's gradle.properties.
Kotlin Learner
  • 3,995
  • 6
  • 47
  • 127
  • 3
    You're working with a beta release of the next Android SDK--I think the warning is normal and expected. Maybe if you use the preview release of Android Studio Hedgehog, it might not warn you: https://developer.android.com/studio/preview – Tenfour04 Jul 28 '23 at 12:18
  • Oh nice, thanks for giving me advice. – Kotlin Learner Jul 28 '23 at 12:21

4 Answers4

0

Since the latest version of the Gradle plugin is 8.1.0 I advise you to keep calm with the warning.

Do not hide the warning, it will remind you about possible issues you have until they release a new version, so we can update it and then remove it safely.

If you just remove the warning something and then something ugly happens… you may lose hours trying to find what's happening

Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162
0

Just update Android Gradle plugin from 8.1.0 to 8.1.1

Sample:

Change

id "com.android.application" version '8.1.0' apply false
id "com.android.library" version '8.1.0' apply false

to

id "com.android.application" version '8.1.1' apply false
id "com.android.library" version '8.1.1' apply false
-1

You also need to update Gradle to a version higher than 8.1.0, as it has been updated to compile with SDK 33. Failure to do so will result in a warning.

Megh
  • 831
  • 2
  • 12
  • 2
    [8.1.0 is the most recent released version of the Gradle plugin.](https://developer.android.com/build/releases/gradle-plugin) It simply doesn't officially support the Android 34 beta yet. – Tenfour04 Jul 28 '23 at 12:52
-1

1> In the project gradle file add the below things

plugins { id ("com.android.application") version "8.1.0" applyfalse
id ("com.android.library") version "8.1.0" apply false
id ("org.jetbrains.kotlin.android") version "1.9.0" apply false
id ("com.google.devtools.ksp") version "1.9.0-1.0.13" apply false }

2> In App Gradle file change compileSdk 34 and targetSdk 34

3> In gradle.properties add: android.suppressUnsupportedCompileSdk=34

4> In gradle-wrapper.properties update distributionUrl: distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip

That's it. Try this I hope it will work for you