The app.Configuration 'compile' is obsolete and has been replaced with 'implementation'

Penny-聽海發表於2018-05-09

AndroidStudio升級後compile 要變成implementation


錯誤提示

For an Android project, the new configurations came with the Android Gradle Plugin 3.0. So unless you are still using the 2.x version of Android Studio / Android Gradle plugin, the use of compile is deprecated. So you should use implementation, even for an app.



Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018



Configuration 'debugCompile' is obsolete and has been replaced with 'debugImplementation'.
It will be removed at the end of 2018



Configuration 'releaseCompile' is obsolete and has been replaced with 'releaseImplementation'.


It will be removed at the end of 2018



解決方法


compile—>implementation

debugCompile—>debugImplementation

releaseCompile—>releaseImplementation

。。。



compile:

              

 可以傳遞依賴引用,編譯時間相對來說長久一些



implementation:

               

不可傳遞依賴引用,比如,B依賴A,C再依賴B,C卻不能依賴A的引用或者依賴。當然他的編譯時間就會短一些。



 對於api代替compile,他們功能相同。



相關文章