当前位置:   article > 正文

Configuration 'compile' is obsolete and has been replaced with 'implementation'

configuration 'compile' is obsolete and has been replaced with 'implementati

Android Studio 3.*.*以上版本编译报错如下

Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’ and ‘api’. 

  1. dependencies {
  2. compile fileTree(dir: 'libs', include: ['*.jar'])
  3. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  4. exclude group: 'com.android.support', module: 'support-annotations'
  5. })
  6. compile 'com.android.support:appcompat-v7:23.0.0'
  7. compile 'com.android.support.constraint:constraint-layout:1.0.2'
  8. testCompile 'junit:junit:4.12'
  9. }

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

  1. dependencies {
  2. implementation fileTree(dir: 'libs', include: ['*.jar'])
  3. androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
  4. exclude group: 'com.android.support', module: 'support-annotations'
  5. })
  6. implementation 'com.android.support:appcompat-v7:23.0.0'
  7. implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  8. testImplementation 'junit:junit:4.12'
  9. }

 

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号