How to add classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" in the new Gradle plugin?

Viewed 372

In the new project Gradle plugin has a lot of changes and I can't add classpath for safe args. How I can solve this problem?

1 Answers

You can manually add this above plugins in your top level build.gradle

buildscript {
    dependencies {
        classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.4.2")
    }
}

And in App level build.gradle

plugins {
    id 'androidx.navigation.safeargs'
}
Related