首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >建立警告?

建立警告?
EN

Stack Overflow用户
提问于 2018-06-23 08:22:22
回答 2查看 60关注 0票数 0

每当我构建android项目时,我都会收到以下警告。

代码语言:javascript
复制
Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation' and 'androidTestApi'. 
Configuration 'androidTestApi' is obsolete and has been replaced with 'androidTestImplementation'.  
Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'.  
Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.    
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.  

我检查了我的Gradle文件,并根据Android的建议,用Implementation指令替换了编译指令。

该应用程序现在运行良好,但我想处理这些警告。

编辑:我的分级文件-

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
    applicationId "com.shaitest.testcam"
    minSdkVersion 23
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
repositories {
mavenCentral()

}
dependencies {

implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
//compile 'com.google.firebase:firebase-invites:15.0.0'
implementation 'com.google.firebase:firebase-invites:11.8.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})

implementation files('libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar')
implementation 'com.facebook.android:facebook-android-sdk:4.30.0'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:support-v4:27.0.2'
testCompile 'junit:junit:4.12'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'

}

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

回答 2

Stack Overflow用户

发布于 2018-06-23 08:40:05

这些警告的意思正是他们所说的。

这些指令现在已经过时(不再使用或过时的)。取代它们,Android有新的指令,这是Android建议您使用的。

通过用新指令替换它们,您已经正确地处理了警告。

票数 1
EN

Stack Overflow用户

发布于 2018-06-23 08:38:55

您的问题本身就有答案了,您需要使用androidTestCompile和其他警告来更改androidTestImplementation

查看文档以获得更多详细信息https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50999354

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档