最近升级了 Android Studio,变成了 Arctic Fox 的版本了。于是当我们新建一个项目的时候,尝试添加一个新的仓库声明。
打开工程根目录下的 build.gradle
123456789101112131415161718
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript{repositories{google()mavenCentral()}dependencies{classpath"com.android.tools.build:gradle:7.0.0"classpath"org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files}}taskclean(type:Delete){deleterootProject.buildDir}
dependencyResolutionManagement{repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)repositories{google()mavenCentral()jcenter()// Warning: this repository is going to shut down soonmaven{url"https://jitpack.io"}//add your repository declaration here}}rootProject.name="ViewLifecycleSample"include':app'