You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I'm trying to write custom annotation processor on AAR(android library).
When I use without android-library gradle plugin then it works fine. But when I enable it then I got error described on #1333.
It seems the resource file of android library compressed twice(lib.aar -> classes.jar -> META-INF). Is there any other solution to resolve it or how to write custom processor with android library?
The text was updated successfully, but these errors were encountered:
KSP processor are run as part of the compilation of a project, in the host machine. Meanwhile AAR is the artifact of an Android library meant to be part of an application that runs in the Android device. Therefore putting the processor in the AAR and as part of an android library does not make sense.
You should have two different artifacts:
The android library containing the runtime code and likely the annotations
The annotation processor library containing the KSP processor and the META-INF file.
Your consumers would then depend on both artifacts and essentially use your library and processor.
For example, Room has its room-runtime artifacts containing the annotations and room-compiler containing the KSP processor.
KSP processor are run as part of the compilation of a project, in the host machine. Meanwhile AAR is the artifact of an Android library meant to be part of an application that runs in the Android device. Therefore putting the processor in the AAR and as part of an android library does not make sense.
You should have two different artifacts:
The android library containing the runtime code and likely the annotations
The annotation processor library containing the KSP processor and the META-INF file.
Your consumers would then depend on both artifacts and essentially use your library and processor.
For example, Room has its room-runtime artifacts containing the annotations and room-compiler containing the KSP processor.
Hi I'm trying to write custom annotation processor on AAR(android library).
When I use without android-library gradle plugin then it works fine. But when I enable it then I got error described on #1333.
It seems the resource file of android library compressed twice(lib.aar -> classes.jar -> META-INF). Is there any other solution to resolve it or how to write custom processor with android library?
The text was updated successfully, but these errors were encountered: