Gradle找不到实现 [英] Gradle Could not find implementationSdkVersion()

查看:105
本文介绍了Gradle找不到实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试构建gradle项目时,我遇到了android studio 3.0.1的问题,我收到此消息"Could not find method implementationSDKVersion()"

I am facing an issue with android studio 3.0.1, when I try to build the gradle project I have this message "Could not find method implementationSDKVersion()"

我的gradle版本是4.1,而android插件版本是3.0.1

my gradle version is 4.1 and android plugin version is 3.0.1

这是我完整的build.gradle文件

here is my complete build.gradle file

apply plugin: 'com.android.application'

android {
 implementationSdkVersion 26 //error on this line
 defaultConfig {
    applicationId "com.anatech.evidencereporter"
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 }
 buildTypes {
     release {
         minifyEnabled false
         proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
     }
 }
}

dependencies {
 implementation fileTree(dir: 'libs', include: ['*.jar'])
 implementation 'com.android.support:appcompat-v7:26.1.0'
 implementation 'com.android.support:design:26.1.0'
 implementation 'com.android.support.constraint:constraint-layout:1.0.2'

 implementation 'com.google.firebase:firebase-core:11.4.2'
 implementation 'com.google.firebase:firebase-database:11.4.2'
 implementation 'com.google.firebase:firebase-storage:11.4.2'
 implementation 'com.firebaseui:firebase-ui-auth:3.1.0'
 implementation 'com.firebaseui:firebase-ui-database:3.1.0'

 implementation 'com.google.android.gms:play-services-places:11.4.2'
 implementation 'com.github.bumptech.glide:glide:3.7.0'

 testImplementation 'junit:junit:4.12'

}

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

有什么建议吗?

推荐答案

问题出在"implementationSdkVersion"中,它应该是"compileSdkVersion".当由于gradle更新而在替换选项工具栏中自动且盲目地将所有编译"一词替换为实现"一词时,就会发生这种情况.描述了"compile"以备将来使用,但没有提供"compileSdkVersion".刚遇到这个问题.

The problem is in "implementationSdkVersion" which should be "compileSdkVersion". It happens when you are replacing automatically and blindly all the words "compile" with the word "implementation", whithout a "words" checkbox in the replacement options toolbar, due to gradle update. "compile" is depricated for a future use but "compileSdkVersion" is not. Just had this issue.

这篇关于Gradle找不到实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆