我正面临名为safeargs
.
我classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.0.0'
在构建gradle中使用过。
在应用插件androidx.navigation.safeargs.kotlin
时app/build.gradle
,我收到以下错误:
原因:androidx.navigation.safeargs 只能用于 androidx 项目
应用程序/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'androidx.navigation.safeargs.kotlin'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.test.navigationexample"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'androidx.navigation:navigation-fragment-ktx:2.0.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.0.0'
}