title: When I add navigation in android studio, I get "Build gradle start up" error and "unable to resolve class val :13" errors
body: <p>I'm learning Kotlin language and when I wanted to add navigation I followed the steps suggested by the official site but my project didn't work</p>
  <p>the error i encountered Gradle sync failed: Cause: startup failed:
  build file 'C:\Users....\Desktop\AndroidStudioProjeler\NavigationKotlin\build.gradle': 13: unable to resolve class val
  @ line 13, column 13.
  val nav_version = &quot;2.3.5&quot;
  ^
  1 error</p>
  <p>line 13 =val nav_version = &quot;2.3.5&quot;</p>
  <pre><code>    plugins {
      id 'com.android.application'
      id 'kotlin-android'
      id(&quot;androidx.navigation.safeargs&quot;)
      id(&quot;androidx.navigation.safeargs.kotlin&quot;)
  }
  
  android {
      compileSdk 31
  
      defaultConfig {
          applicationId &quot;com.example.navigationkotlin&quot;
          minSdk 23
          targetSdk 31
          versionCode 1
          versionName &quot;1.0&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      kotlinOptions {
          jvmTarget = '1.8'
      }
  }
  
  dependencies {
  
          val nav_version = &quot;2.3.5&quot;
  
  
      // Kotlin
      implementation(&quot;androidx.navigation:navigation-fragment-ktx:$nav_version&quot;)
      implementation(&quot;androidx.navigation:navigation-ui-ktx:$nav_version&quot;)
  
  
      implementation 'androidx.core:core-ktx:1.7.0'
      implementation 'androidx.appcompat:appcompat:1.4.0'
      implementation 'com.google.android.material:material:1.4.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
      testImplementation 'junit:junit:4.+'
      androidTestImplementation 'androidx.test.ext:junit:1.1.3'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    
  
  }
  </code></pre>
  <p>buil.gradle</p>
  <pre><code>
  buildscript {
    ext.nav_version = &quot;2.3.5&quot;
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
        classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.5&quot;
  
        val nav_version = &quot;2.3.5&quot;
        classpath(&quot;androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version&quot;)
    }
  }
  
  task clean(type: Delete) {
    delete rootProject.buildDir
  }
  </code></pre>