Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.9K
Views
How to add classpath in new version of Android Studio

I updated my android studio version to bumblebee version.
Now I want add navigation component to my project.
I want add classpath to gradle, but this file gradle has been changed and I don'y know how can I add this.

I want add this classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version") to gradle files!

My project gradle file is :

    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
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

How can I add this classpath to application gradle ?!

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

They haven't talked about in the release docs but manually add a buildscript block above the plugins block then inside the buildscript block add a depedencies block.

like this:

buildscript {

        dependencies {

              classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.4.0")

                     }
       }


plugins {
      id 'com.android.application' version '7.1.0-rc01' apply false
      //......
    }
over 4 years ago · Santiago Trujillo Report

0

In the latest version in February 2022 doesn't need to add buildscript anymore just add the id in build.gradle for project. It will be like this in build.gradle for project:

plugins {
    id 'com.android.application' version '7.1.2' apply false
    id 'com.android.library' version '7.1.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.6.10' apply false

    id 'androidx.navigation.safeargs' version '2.4.1' apply false
    // classpath are changed, so no need to add classpath anymore just the id and the version
}

Don't forget add the id again in the build.gradle module,

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'androidx.navigation.safeargs'
}
over 4 years ago · Santiago Trujillo Report

0

So they mentioned that in the build.Gradle file as top-level comment And I saw it as a bad practice by don't mention it floow that
1- open your build.Gradle (app module) scroll to the top until you see that comment // Top-level build file where you can add configuration options common to all sub-projects/modules.

then take this code As copy put it this line isenter image description here builtin comment // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

dependencies {

    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:lasted-version"

}

}

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!