Dagger 2 connected:
plugins { id 'idea' id 'java' id "net.ltgt.apt" version "0.10" } dependencies { compile 'com.google.dagger:dagger:2.16' apt 'com.google.dagger:dagger-compiler:2.16' } It all worked fine, until suddenly Lombok appeared:
plugins { id 'idea' id 'java' id "net.ltgt.apt" version "0.10" } dependencies { compile 'com.google.dagger:dagger:2.16' apt 'com.google.dagger:dagger-compiler:2.16' compile 'org.projectlombok:lombok:1.18.0' apt "org.projectlombok:lombok:1.18.0" } The problem is that it requires the Enable annotation processing flag, otherwise Idea does not understand where to get the methods generated by the library.
But if you enable Annotation processing, then dagger files are generated twice (as far as I understood the first time through apt, the second time through annotation processing or vice versa):
Error:(18, 29) java: Could not generate unknown file: Attempt to recreate a file for type имя_класса It turns out like this:
- we switch off annotation processing - lombok falls off
- we include annotation processing - dagger falls off
- enable annotation processing + delete
apt 'com.google.dagger:dagger-compiler:2.16'- the assembly in gradle falls off