Skip to content Skip to sidebar Skip to footer

Android Gradle Annotationprocessor Not Available In Parent Module

I'm having the following setup: ProjectA build.gralde: dependencies { compile (project(':ProjectB')) } ProjectB build.gradle: dependencies { annotationProcessor 'com.ryanh

Solution 1:

annotationProcessor dependencies are not exported to other projects. Also these are not exported with libraries.

AutoValue itself works, because you defined it with a compile dependency. This is something you should not do either. So an better dependency setup would look like...

ProjectB

dependencies {
    provided "com.jakewharton.auto.value:auto-value-annotations:$autoValueVersion"
    annotationProcessor "com.google.auto.value:auto-value:$autoValueVersion"
    annotationProcessor "com.ryanharter.auto.value:auto-value-parcel:$autoValueParcelVersion"
}

ProjectA

dependencies {
    compile project(':ProjectB')
    provided "com.jakewharton.auto.value:auto-value-annotations:$autoValueVersion"
    annotationProcessor "com.google.auto.value:auto-value:$autoValueVersion"
    annotationProcessor "com.ryanharter.auto.value:auto-value-parcel:$autoValueParcelVersion"
}

But not having annotationProcessor run on all projects would be even better.

Post a Comment for "Android Gradle Annotationprocessor Not Available In Parent Module"