Tambahkan classpath berikut pada build.gradle diluar folder app
def nav_version = "2.4.2"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.2"
lalu tambahkan plugins pada build.gradle app
id 'androidx.navigation.safeargs'
tambahkan berikut ke build.gradle
packagingOptions {
resources.excludes += "DebugProbesKt.bin"
}
dependencies {
// NOTE: CodeAssist does NOT support adding dependencies here,
// use the library manager instead
def nav_version = "2.4.2"
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.navigation:navigation-fragment:2.4.2'
implementation 'androidx.navigation:navigation-ui:2.4.2'
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version") {
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
}
}