How do I add safeargs and secrets as a plugin, or must it remain as dependency?
The latest Kotlin template for new fragment + view model build.gradle(Project) uses plugins {} not dependencies {} Here is my work around, how do convert a classpath with path:plugin:version plugin id.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
// not compatible with upgraded gradle classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.0"
//https://stackoverflow.com/questions/70857476/unable-to-load-class-androidcomponentsextension-after-upgrading-the-android-grad/70857477
// Update this line to use 2.5.0-alpha01
// While Navigation 2.4.1 is not out yet
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0-alpha01"
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0"
}
}
// buildscript MUST come before this these are used in the project build.gradle not a dependency
/* This came with the 'new project template' replaced with old style dependencies,
plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
} */
The build.gradle for the module, is different, no version, so easy to convert.