'Plugin with id 'androidx.navigation.safeargs' not found in new version android

I'm going to https://developer.android.com/jetpack/androidx/releases/navigation but I get an error when syncing the id 'androidx.navigation.safeargs' plugin which you can see in the image below

image build.gradle(moduleApp)

image builde.gradle(project)

image My dependencies

image My error



Solution 1:[1]

To fix this error, add the following code to build.gradle (project) and sync the project

buildscript {

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

Next add this code to build.gradle(module)

id 'androidx.navigation.safeargs'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mehdi