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 (后)
截圖所示:
以上兩指令說明
compile: 如有模塊之間存在依賴的話,引用是正常的。 implementation: 引用的庫只能在當前模塊中使用,即便模塊之間存在依賴關系的話,也不可以引用。 說到以上,舉一個不是很恰當的例子,有點像:Java中 public 與 private