'How to import classPath in new Bumblebee Android Studio?
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")
Solution 1:[1]
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
}
Solution 2:[2]
Finally I found solution, and I comment here for someone need it
id 'androidx.navigation.safeargs.kotlin' version '2.4.0' apply(false)
Solution 3:[3]
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
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nitin Prakash |
| Solution 2 | Anh Luu |
| Solution 3 | Tippu Fisal Sheriff |

