Quando coloquei o código no arquivo do gradle, o "def" não funcionou e o "kapt" também. Apareceu uma lista grande de erros:
Código completo do build.gradle do app:
import org.jetbrains.kotlin.kapt3.base.Kapt.kapt
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id ("kotlin-parcelize")
id ("kotlin-kapt")
}
android {
namespace = "br.com.alura.orgs"
compileSdk = 33
defaultConfig {
applicationId = "br.com.alura.orgs"
minSdk = 24
targetSdk = 33
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
buildTypes {
release {
isMinifyEnabled = 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
viewBinding = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
dependencies {
def room_version = "2.3.0"
implementation ("androidx.room:room-runtime:$room_version")
kapt ("androidx.room:room-compiler:$room_version")
// outras dependências...
}