Hi folks, I'm using kotlin dsl in my gradle script...
# gradle
g
Hi folks, I'm using kotlin dsl in my gradle scripts for android project, but as is showing me
Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
a brief view of my gradle file is this:
Copy code
plugins {
	id("com.android.application")
	kotlin("android")
}

android {
	compileSdkVersion(TARGET_SDK_VERSION)

	defaultConfig {
		minSdkVersion(MIN_SDK_VERSION)
		targetSdkVersion(TARGET_SDK_VERSION)

		testInstrumentationRunner("androidx.test.runner.AndroidJUnitRunner")
		consumerProguardFiles("<http://consumer-rules.pro|consumer-rules.pro>")
	}

	buildTypes {
		getByName("release") {
			isMinifyEnabled = false
			proguardFiles(
				getDefaultProguardFile("proguard-android-optimize.txt"),
				"<http://proguard-rules.pro|proguard-rules.pro>"
			)
		}
	}

	compileOptions {
		sourceCompatibility = JavaVersion.VERSION_1_8
		targetCompatibility = JavaVersion.VERSION_1_8
	}

	kotlinOptions {
		jvmTarget = "1.8"
		useIR = true
	}

	buildFeatures {
		compose = true
	}
	composeOptions {
		kotlinCompilerExtensionVersion = COMPOSE_VERSION
		kotlinCompilerVersion = KOTLIN_VERSION
	}
}
v
Where do you have this in? Is that a top-level build script, something you use with
apply from
or a pre-compiled script plugin?
n
is that the only error inthe build? a lot of times this masks another error
j
message has been deleted
1
@Vampire using that method fix the problem, with agp alpha 15 the property
targetCompatibility
only works with library modules for me, with application I have to use that method
g
I'll try removing bits of it and see if it fixes it, thanks folks