Configuration implementation ,androidTestImplementation ,testImplementation編譯器報錯

Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation' and 'androidTestApi'.

原因是AS3.0之後你的配置裏面有些api過時了

例:

這些紅線處過時

需要改成如下: 
compile 改成implementation 
androidTestCompile改成androidTestImplementation 
testCompile 改成testImplementation

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    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.+'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:support-v4:28.0.0'
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章