skip to Main Content

After updating new Bumblebee Android Studio, I created a new project and see that the build.gradle changed with new form

    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 could I import new classPath as before? Such as

  dependencies {
    classpath 'com.android.tools.build:gradle:7.0.4'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$ktl_gradle_ver"
}

I wanna to import classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version")

3

Answers


  1. Chosen as BEST ANSWER

    Finally I found solution, and I comment here for someone need it

     id 'androidx.navigation.safeargs.kotlin' version '2.4.0' apply(false)
    

  2. Use buildscript before plugins it will work and put your classpath there in the dependencies block

    buildscript {
        dependencies {
            classpath("com.google.dagger:hilt-android-gradle-plugin:2.40.5")
        }
    }
    
    
    plugins {
        id 'com.android.application' version '7.1.0-rc01' apply false
        id 'com.android.library' version '7.1.0-rc01' apply false
        id 'org.jetbrains.kotlin.android' version '1.5.30' apply false
    }
    
    
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
    Login or Signup to reply.
  3. enter image description here

    Step 1:
    Open

     build.gradle(Project: MyFirstProject)
    

    Step 2: Add buildscript above plugins then add dependencies block inside buildscript.

    Reference Code:

    buildscript {
        dependencies {
            classpath "com.google.dagger:hilt-android-gradle-plugin:2.28.3-alpha"
        }
    }
    
    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    plugins {
        id 'com.android.application' version '7.1.1' apply false
        id 'com.android.library' version '7.1.1' apply false
        id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search