0

I have a project working perfectly. Migrated to androidX and after that I see my annotation processor are not working.

Already done all the package changes mentioned in this link: https://developer.android.com/jetpack/androidx/migrate even used the migration tool.

Followed the steps mentioned by this guy :Annotation processor not working - no files are created Sanity checks will qoute the above: I tried the common solutions:

  • remove my project from Android Studio recents
  • invalidate cache and restart android studio
  • import my project again into android studio (made sure that annotation processing is enabled before)
  • Added > apply plugin: 'kotlin-android'

Followed the steps this guy mentioned: Enable Annotation processing for existing projects Android studio 3.3

Looked for examples on annotation processing but all of them are before the androidX upgrade:

I did notice that the way annotation processors work are slightly different I am using "kapt project(':xx')" instead of "annotationProcessor project(path: ':xxx')"

Any advise I do feel this question is valid even though there are a lot of content out there cannot find anything specific to AndroidX and Annotation processor except this: Migrate annotation processor to androidX and that does not answer the question because I already done the package changes?

enter image description here

  • Do share the screenshot ,Where you are getting errors – Priyanka Oct 07 '20 at 09:23
  • The errors I am getting is because of the classes that should be generated are not found and that is correct because my theory is that my annotation processor are not executing and that means the JavaPoet code I have do not generate the code I need. Also tried looking at JavaPoet in AndroidX upgrade but seems to be compatible. – Jethro Gibbs Oct 08 '20 at 05:49
  • There can be name changed for these particular annotations that you were using before, May be thats why it is giving errors. – Priyanka Oct 08 '20 at 06:11
  • Added screenshot of my package. The annotations I am using are custom to generate the DB boilerplate code. Only using _@Retention(RetentionPolicy.SOURCE)And@Target(ElementType.METHOD)_ for each annotation seems like they stayed the same but thanks I will check. – Jethro Gibbs Oct 08 '20 at 07:58

1 Answers1

0

Seems like I needed to upgrade Gradle to higher version after redoing the entire process upgraded Gradle to version 6.1.1 and worked like a charm.