how to add safeargs to project level Kotlin gradle

Viewed 490

Another user asked the same question, but I could not understand the solution. I also don't understand why the Android Developer page doesn't show a path according to this new version.

buildscript {
repositories {
    google()
}
dependencies {
    val nav_version = "2.4.2"
    classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version")
}
}

These are the codes I need to add for navigation, but in the new project gradle;

plugins {
id 'com.android.application' version '7.1.3' apply false
id 'com.android.library' version '7.1.3' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false }

These methods are written. Where should I write the Build Script and dependencies methods?

2 Answers
plugins {
    id 'com.android.application' version '7.2.1' apply false
    id 'com.android.library' version '7.2.1' apply false   
    id 'androidx.navigation.safeargs.kotlin' version '2.4.2' apply false
}

add in build.gradle (Project):

id 'androidx.navigation.safeargs.kotlin' version '2.5.1' apply false

And in build.gradle (Module) add:

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'androidx.navigation.safeargs.kotlin'
}
Related