// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() google()//google() 方法的作用是向 Gradle 声明项目需要从 Google Maven 仓库中获取依赖。 //这样一来,你就可以在你的 Android 项目中使用诸如 Google Play 服务、Android Support 库等由 Google 提供的依赖了。 } dependencies { classpath 'com.android.tools.build:gradle:7.4.1' } } allprojects { repositories { google() jcenter() } }