小编Shr*_*ora的帖子

无法为 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象设置未知属性“nav_version”

我试图添加导航依赖项以在我的项目中使用导航图,而 android studio 抛出了这个错误。

这是我的项目 Gradle 文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
        nav_version = "2.3.0-alpha01" //extra property, used like variables
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete …
Run Code Online (Sandbox Code Playgroud)

java navigation android gradle kotlin

2
推荐指数
1
解决办法
3858
查看次数

标签 统计

android ×1

gradle ×1

java ×1

kotlin ×1

navigation ×1