Questions tagged [annotation-processor]

100 questions
60
votes
9 answers

Setting Explict Annotation Processor

I am attempting to add a maven repository to my Android Studio project. When I do a Gradle project sync everything is fine. However, whenever I try to build my apk, I get this error: Execution failed for task ':app:javaPreCompileDebug'. > Annotation…
wmrice
  • 601
  • 1
  • 5
  • 3
24
votes
1 answer

Enable Annotation processors by default

How can I configure IntelliJ IDEA to have Annotation processors enabled by default? Currently, I have to enable it manually for every imported project.
Andrii Abramov
  • 7,967
  • 8
  • 55
  • 79
19
votes
6 answers

Error:Failed to resolve: annotationProcessor

This is the following error I am getting while adding a new gradle dependency to my android project. And this error is not project specific. I am getting the same error if I am adding the plugin in any other android project Error while adding any…
sagar suri
  • 3,343
  • 7
  • 41
  • 94
15
votes
1 answer

Dagger 2 with Android Studio 3.0 Preview (Canary 2) using annotationProcessor instead of android-apt

"A long time ago in a galaxy far, far away...." Ok, long story short - I decided to give Android Studio 3.0 Preview (Canary 2) a shot and I cannot make it work with Dagger 2 using annotationProcessor instead of android-apt. The error message I get…
11
votes
3 answers

Dagger can not find classes generated by other annotation processor

I have written a simple Annotation Processor (just for fun) that will generate some boilerplate code that I have been writing in my previous project. It actually generates a module like following by collecting annotations on Activity…
10
votes
3 answers

How to configure Java Annotation Processor(s) in Eclipse?

I have successfully run annotation processor for CLASS level retention annotations via command prompt compiling using Java 8. However, when I tried to configure the annotation processor in eclipse and tried to run it with "-proc:only" option, it…
Animesh
  • 159
  • 1
  • 3
  • 10
9
votes
2 answers

How to process annotations with @Target(ElementType.TYPE_USE)?

I'm implementing an annotation processor to make sure that the elements marked with an annotation are instances of a class that implements a certain interface, or are uses of types that implement a certain interface: @Documented @Target(value = {…
9
votes
2 answers

annotationProcessor + androidTest + dagger2

For instrumented tests, I have a TestApplication that creates a TestComponent, but the file is not generated anymore (Error:/xxx/TestApplication.java:16: The import.xxx.DaggerTestApplicationComponent cannot be resolved). I'm not able to identify the…
8
votes
3 answers

Room annotation processor with Data binding

I have used Data binding in my existing code and now I am migrating to Room for persistence. I have followed the steps mentioned in Florina's Blog for room My Code builds fine without java code error or BR related error when I remove room…
8
votes
4 answers

Can't Debug an Annotation Processor when using kapt and gradle

I'm building an annotation processor, and I recently switched from using the default annotationProcessor type to kapt, using the kotlin-kapt plugin. I was debugging my processor by using the command ./gradlew --no-daemon -Dorg.gradle.debug=true…
8
votes
1 answer

annotationprocessor and apt configure equivalent

I'm using AndroidAnnotaion, but due to Android Studio 2.3 and Gradle 2.3.0, they said android-apt was obsoleted. And annotationProcessor is a new one. so, I want to know how can I configure annotationProcessor like I do with apt before. If I…
7
votes
1 answer

how can I use annotationProcessor in android.mk

I just want to use bufferknife and drag2 in my system app, I have built my app with the command mm. I have tried every possible method I could find, but failed! I've only found the below Android.mk by Googling: # Copyright (C) 2015 The Android Open…
feng
  • 71
  • 3
7
votes
2 answers

Android Studio 2.3 update : Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior

So, I have read all the questions I could find on this site regarding this issue. I have also had a chat in comments with one of the developer with similar issue, who was able to solve it. I dont have apt or annotationProcessor written any where in…
legalimpurity
  • 190
  • 3
  • 12
6
votes
2 answers

Is there a way to create custom annotations in Scala and write a custom annotation processor to verify the annotations?

I have been learning about annotations and what an annotation processor is. I was looking at Java examples and there seems to be a proper way to do it. However, in Scala, I do not get a proper website/documentation to create custom annotations and…
6
votes
1 answer

How do you specify buildConfigField in Gradle Java-library Project build script

Within my Android projects I can specify Gradle constants as follows: buildConfigField 'Boolean', 'analyticsEnabled', 'false' and access them in my Android application like this:- public boolean isAnalyticsEnabled() { return…
Hector
  • 2,024
  • 15
  • 69
  • 142
1
2 3 4 5 6 7