Android Studio unresolved references

Hi,
I have a legacy Java Android project and I created a new one on its base. When I try to debug build.gradle.kts Module:app it shows unresolved reference errors for each lines of build.gradle.kts Module:app file.
Why this mysterious error, please?

build.gradle.kts Module:app:

plugins {
    id("com.android.application")
}

android {
    namespace = "mynamespace "
    compileSdk = 34

    defaultConfig {
        applicationId = "mynamespace"
        minSdk = 33
        targetSdk = 33
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }
    packaging { resources.excludes.add("META-INF/*") }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    buildFeatures {
        viewBinding = true
    }
}

dependencies {

    implementation("androidx.appcompat:appcompat:1.6.1")
    implementation("com.google.android.material:material:1.10.0")
    implementation("androidx.constraintlayout:constraintlayout:2.1.4")
    implementation(files("libs\\android-support-v4.jar"))
    implementation(files("libs\\httpcore-4.4.16.jar"))
    implementation(files("libs\\httpclient-4.5.14.jar"))
    implementation("com.squareup.picasso:picasso:2.8");
    implementation("com.loopj.android:android-async-http:1.4.11")
    implementation("com.google.android.gms:play-services-maps:18.2.0")
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}

What exactly is the “mysterious error”?
Can you maybe share a build --scan?

Btw. you should strongly consider not using files(...) or fileTree(...) for dependencies, but better use a flatDir repository and normal dependency declarations with that.

Hi Björn,
This is my first Android project so I am totally lost.
I could manage to run build --scan and I found the errors.
Tank you for elping me.

1 Like