1

All is in the title ;)

I cannot get rid of this error at build time... I've checked how to add the "-AparcelerStacktrace" compiler argument for this library but didn't find it on its Github repo. I've also checked how to simply add a "generic" compiler argument but didn't find how too...

I'm a bit stuck with this error :/

For info, I'm using Parceler 1.0.1.

EDIT

Finally, the error message appeared because of a duplicate of a class with a @Parcel annotation... However, I let the post opened to know how to add a compiler argument in Android ;)

Doc_1faux
  • 141
  • 5
  • 15

1 Answers1

3

To add annotation processor arguments (-A...) you just need to configure the compiler.

In Maven this is configured via the maven-compiler-plugin as follows:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <configuration>
        <compilerArguments>
            <AparcelerStacktrace/>
        </compilerArguments>
    </configuration>
</plugin>

In gradle this is configured for Android as follows:

android {
    ...
    defaultConfig {
        ...
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [
                    parcelerStacktrace: "true"
                ]
            }
        }
    }
}
John Ericksen
  • 10,995
  • 4
  • 45
  • 75
  • 1
    I opened the post a long ago, but I finally had to use a compiler argument & your response helped me a lot, so I mark your answer as accepted ;) Thanks a lot! – Doc_1faux Aug 31 '18 at 13:31