首页 文章

“指定的Android SDK Build Tools版本(26.0.0)被忽略......”[关闭]

提问于
浏览
1

在Android Studio 3.0.2中,我看到了这个问题:

配置'compile'已经过时,已被'implementation'取代 . 它将在2018年底删除

指定的Android SDK Build Tools版本(26.0.2)将被忽略,因为它低于Android Gradle Plugin 3.1.0的最低支持版本(27.0.3) . 将使用Android SDK Build Tools 27.0.3 . 要取消此警告,请从build.gradle文件中删除“buildToolsVersion '26 .0.2'”,因为每个版本的Android Gradle Plugin现在都有一个默认版本的构建工具 .

这是我的项目的屏幕截图:

enter image description here

2 回答

  • 3

    如果问题是 - “如何解决此错误?” - 然后就改变这个

    android {
        compileSdkVersion 27
        buildToolsVersion "27.0.3"
    }
    

    请确保您也通过SDK Tools右侧版本27.0.3中的SDK管理器进行了安装(在您将检查角落“显示包详细信息”后将显示)

    但是,您可能会在依赖项中出现更多错误 . 当您将鼠标的光标指向错误的行时,您应该看到有关建议的工具提示,如何修复此错误 - 通常您只需要重写:

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.1.0'
        implementation 'com.android.support:design:27.1.0'
        implementation 'com.android.support.constraint:constraint-layout:1.0.2'
        implementation 'com.android.support:support-v4:27.1.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    }
    
  • 0

    谢谢

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "27.0.3"
        defaultConfig {
            minSdkVersion 27
        }
        productFlavors {
        }
    }
    
        defaultConfig {
            applicationId "net.mobilegts.appname"
            minSdkVersion 14
            targetSdkVersion 27
            multiDexEnabled true
    
    
        }
    
        dexOptions {
            // Prevent OutOfMemory with MultiDex during the build phase
            javaMaxHeapSize "4g"
        }
    
        buildTypes {
            release {
                minifyEnabled false
                shrinkResources false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
    
    
        }
        sourceSets.main {
            jni.srcDirs = []// <-- disable automatic ndk-build call
        }
    }
    
    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:27.1.0'
        implementation 'com.android.support:design:27.1.0'
        implementation 'com.android.support.constraint:constraint-layout:1.0.2'
        implementation 'com.android.support:support-v4:27.1.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    }
    

    enter image description here

相关问题