警告:配置'compile'已过时,并已由'implementation'和'api'代替
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了警告:配置'compile'已过时,并已由'implementation'和'api'代替相关的知识,希望对你有一定的参考价值。
在myapp / build.gradle中,我不使用编译配置,但保持不显示此警告
配置'compile'已过时,已被替换为“实现”和“ api”。
这是我的app / build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "org.apoce.app"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
defaultConfig{
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.satyan:sugar:1.4'
implementation 'com.jude:swipebackhelper:3.1.2'
implementation 'ch.acra:acra:4.9.0'
implementation 'com.google.firebase:firebase-messaging:9.6.1'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
答案
我只是将google服务更新到最新版本并解决了问题
以上是关于警告:配置'compile'已过时,并已由'implementation'和'api'代替的主要内容,如果未能解决你的问题,请参考以下文章
Gradle:DSL 元素“useProguard”已过时,将很快被删除
解决idea中maven默认jdk为1.5的问题 : IntelliJ IDEA 源值1.5已过时,将在未来所有版本中删除
解决Configuration 'compile' is obsolete and has been replaced with implementation
警告:API 'variant.getJavaCompile()' 已过时,已替换为 'variant.getJavaCompileProvider()'
ConfigurationSettings.AppSettings 已过时,警告
警告:API 'variant.getMergeResources()' 已过时,已替换为 'variant.getMergeResourcesProvider()'