在我的build.gradle文件中,我设置了以下依赖项:
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
Run Code Online (Sandbox Code Playgroud)
这将自动适应最新发布的版本(像它的描述在这里).
如何查看我的项目中使用的当前版本?
编辑2013-08-08:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
Run Code Online (Sandbox Code Playgroud) 对于使用gradle 7.2创建的android项目,项目gradle与之前的有很大不同,它现在只包含这些
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
settings.gradle也与以前有很大不同,它现在包含更多配置,如下
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
// classpath 'com.google.gms:google-services:4.3.10'
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "My App"
include ':app'
Run Code Online (Sandbox Code Playgroud)
在哪里可以添加类路径classpath 'com.google.gms:google-services:4.3.10'?当我将其添加到 …