我在使用android studio 3.0.1时遇到了一个问题,当我尝试构建gradle项目时,我收到了以下消息"Could not find method implementationSDKVersion()"
我的gradle版本是4.1
和android插件版本是3.0.1
下面是我完整build.gradle文件
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'
有什么建议吗?
1条答案
按热度按时间laik7k3q1#
问题出在
implementationSdkVersion
中,应该是compileSdkVersion
。由于Gradle更新,当您自动盲目地将所有单词“compile”替换为单词“implementation”时,如果替换选项工具栏中没有“words”复选框,就会出现此问题。compile
已弃用,但compileSdkVersion
尚未弃用。