Hi everyone. I am having some major trouble trying...
# community-support
q
Hi everyone. I am having some major trouble trying to get my Project to compile with no errors. This project was last updated in Android studio flamingo(October 2022) but now i need to update it to the latest version and cant get it to configure with out errors. My main issue is getting Kotlin to configure properly. This is my build.gradle (app):
Copy code
plugins{
    id 'org.jetbrain.kotlin' version '2.1.20'
}

apply plugin: 'com.android.application'

android {
    namespace "com.example.btdoor"
    compileSdk 35

    defaultConfig {
        applicationId "com.example.btdoor"
        minSdkVersion 16
        targetSdkVersion 35
        versionCode 1
        versionName "0.0.04"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }


        applicationVariants.all {
                // this method is use to rename your all apk weather
                // it may be signed or unsigned(debug apk)
            variant ->
                variant.outputs.each {
                        // on below line we are setting a
                        // name to our apk as GFG.apk
                    output ->
                        def name = "BTdoor v" + versionName + ".apk"
                        // on below line we are setting the
                        // outputFile Name to our apk file.
                        output.outputFileName = name
                }
        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.16.0'
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.2.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}
Any help is well appreciated. Here is the link for the build scan:https://scans.gradle.com/s/2gu7hpgatgod6
v
Besides that you should • not use
apply plugin
but the
plugins { ... }
block • not use
fileTree
or
files
for dependencies, but a
flatDir
repository with "normal" dependency decalarations You missed to tell us what problem you have. "I'm getting errors" is like going to your doctor and saying "It hurts". šŸ˜‰ Optimally, share the error using a build
--scan
URL.
q
Fair enough. I am still new to all of this. Here is the link https://scans.gradle.com/s/2gu7hpgatgod6
as for the error, it is hard to explain. Its more like before i tried to make any changes, it gave a warning that kotlin was not configured and that many of the gradle features were deprecated yet it does not necessarily state what was deprecated.
v
You run a Gradle 7.3 build using Java 20, this is not supported: https://docs.gradle.org/current/userguide/compatibility.html
that many of the gradle features were deprecated yet it does not necessarily state what was deprecated.
The build scan will list exactly what deprecated things you used, or without a build-scan the error message told you how to get them listed
Those do not make the build fail though, they are just deprecation warnings and will soonest fail when you try to upgrade Gradle
q
This helps a lot. Thank you very much
šŸ‘Œ 1