AndroidStudio 3.0升級之compile、implementation簡要說明


1.現象

androidStudio 升級至3.0后 之前引用庫所使用的complie默認變成implementation
如以下:
    3.0之前
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    compile 'io.reactivex.rxjava2:rxjava:2.1.3'

    3.0之后
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.3'
除以上之外,還有以下:

 androidTestCompile(前)  
 androidTestImplementation(后)  


 testCompile(前)
 testImplementation (后)

截圖所示:

desc.png

以上兩指令說明

compile: 如有模塊之間存在依賴的話,引用是正常的。 implementation: 引用的庫只能在當前模塊中使用,即便模塊之間存在依賴關系的話,也不可以引用。 說到以上,舉一個不是很恰當的例子,有點像:Java中 public 與 private

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM