1

我更新到 Android studio Bumblebee 2021.1.1 , gradle.settings(Project) 文件结构发生变化,我现在如何添加依赖项和类路径以进行刀柄或导航?

Android Studio 毕业

4

3 回答 3

0

您可以在项目级别 bulild.gradle 中使用如下 dagger-hilt 依赖项

id 'com.google.dagger.hilt.android' version '2.41' apply false
于 2022-03-04T03:34:54.337 回答
0

您可以在第一行添加它在 此处输入图像描述

于 2022-02-25T10:01:11.697 回答
0

buildscript 块中添加项目级别的依赖项,如下所示:

buildscript {
    ext {
        compose_version = '1.2.0-alpha04'
        hilt_version = '2.41'
        accompanist_version = '0.24.2-alpha'
    }
    dependencies {
        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.40.5'\
    }
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.3.0-alpha03' apply false
    id 'com.android.library' version '7.3.0-alpha03' apply false
    id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
于 2022-02-25T10:13:08.783 回答