应该从buildToolsVersion"中删除哪一行?来自build.gradle?

时间:2018-01-18 10:26:34

标签: android android-studio build.gradle

我第一次尝试使用Android Studio(3)。可能我在问一个愚蠢的问题,但我没有找到任何关于我在互联网上的知识水平的确切答案。

我试图修改一个Android项目,并且超过一小时Android Studio只是更新和同步gradle。在所有这些之后,它显示了这样一个警告:

Warning:The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.1.
Android SDK Build Tools 26.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

这是build.gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.brommko.android.universalwebview"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 14
        versionName "3.4"
        manifestPlaceholders = [manifestApplicationId          : "${applicationId}",
                                onesignal_app_id               : "c0fbadc6-4013-4613-b00b-566eab144d3c",
                                onesignal_google_project_number: "4122760152"]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'com.onesignal:OneSignal:3.+@aar'
    compile 'com.google.android.gms:play-services-gcm:10.0.1'
    compile "com.google.android.gms:play-services-location:10.0.1"
    compile 'com.github.quentin7b:android-location-tracker:3.2'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.firebase:firebase-ads:10.0.1'
    compile 'com.google.firebase:firebase-crash:10.0.1'
    compile 'org.jetbrains:annotations-java5:15.0'
    compile 'com.github.hotchemi:android-rate:1.0.1'
}

apply plugin: 'com.google.gms.google-services'

请记住,我是Android Studio中的新手 感谢您的关注!

2 个答案:

答案 0 :(得分:2)

删除

buildToolsVersion "25.0.2"

位于android {} block

答案 1 :(得分:0)

完全删除“ buildToolsVersion ....”行。这样,Gradle将始终自动使用与当前版本的Gradle一起使用的正确的默认版本的构建工具。