天天看點

Android 引用本地Module,依賴module中的依賴庫找不見類的原因

android studio更新之後3.0,突然就找不到module裡面的依賴庫了,主要是compile都換成implementation造成的影響,下面看一下他們的差別:

implementation聲明的依賴包隻限于子產品内部使用,不允許其他子產品使用。

api聲明的依賴包時, 子產品依賴于此子產品,此子產品使用api聲明的依賴包是可以被其他子產品使用

在app 的build.gradle 中把依賴替換,替換如下:              

     compile 要用 implementation 或 api 替換

     testCompile 要用 testImplementation 或 testApi 替換

     androidTestCompile 要用 androidTestImplementation 或 androidTestApi 替換

依賴module的build.gradle 中的,把implementation 替換成 api,編譯即可

繼續閱讀