本地的com.android.tools.build:gradle版本在哪儿看

我新建一个安卓空项目,build gradle文件里面没有tools版本号

  • 请看👉 :Android Studio——不会报错的build.gradle到底长啥样
  • 除此之外, 这篇博客: Android build.gradle文件详解(转述自《Android第一行代码》第二版)中的 2. app目录下的build.gradle文件 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
  • 下面代码都是我自己项目中复制出来的,有文章中没有说到的地方,可以暂时忽略。

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 29
        buildToolsVersion "29.0.0"
        defaultConfig {
            applicationId "com.timemanagersystem"
            minSdkVersion 19
            targetSdkVersion 29
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
        useLibrary 'org.apache.http.legacy'
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test:runner:1.2.0'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    
        implementation 'cn.bmob.android:bmob-sdk:3.7.3-rc1'
        implementation "io.reactivex.rxjava2:rxjava:2.2.2"
        implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
        implementation 'com.squareup.okio:okio:2.1.0'
    }