enable Annotation Processors option in Android Studio 2.2

后端 未结 10 1357
逝去的感伤
逝去的感伤 2020-12-03 00:58

I\'m trying to use java 8 in my project and for that I added the jack compiler.

After enabling jack I started having problems with libraries that use Annotation Proc

相关标签:
10条回答
  • 2020-12-03 01:06

    Open compiler.xml in the .idea folder. I had the following:

    <annotationProcessing>
      <profile default="true" name="Default" enabled="false">
        <processorPath useClasspath="true" />
      </profile>
    </annotationProcessing>
    

    I simply changed enable to true and re-opened project.

    0 讨论(0)
  • 2020-12-03 01:08

    This Answer for those who face this problem in the future

    For Kotlin

    Add kapt plugin

    apply plugin: 'kotlin-kapt'
    implementation 'com.google.dagger:dagger:2.21'
    kapt 'com.google.dagger:dagger-compiler:2.21'
    

    For Java

    implementation 'com.google.dagger:dagger:2.21'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.21'
    
    0 讨论(0)
  • 2020-12-03 01:09

    https://stackoverflow.com/a/38698186/4024146

    and after do: File > Invalidate Caches / Restart... > Invalidate and Restart

    0 讨论(0)
  • 2020-12-03 01:19

    Sometimes the annotate option will be grayed out if the project is not integrated into version control. So goto VCS->Enable version control integration then voila you will see the annotate option and can see the author name beside the line numbers on the editor.

    0 讨论(0)
  • 2020-12-03 01:20

    Stuped but worked for me, try to change the library version in my case I upgraded to 1.4.1

    0 讨论(0)
  • 2020-12-03 01:21
    1. Close all your AndroidStudio Project
    2. See

    3. Click Configure-->Setting See

    0 讨论(0)
提交回复
热议问题