Android - Annotations are not working when minifyEnabled is true in gradle

Product: PDFTron SDK

Product Version: 9.0177774


I have built a custom annotator UI using custom tools. Everything is working fine in debug mode but when I enable minifyEnabled=true and generate / run the build, the annotations are not working. No annotations are added, the document is scrolling like when Pan tool is used. I have valid license key as well.

Please let me know what would be reason for this.

Thank You

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hi, you need to add @Keep for any custom tool you added, i.e.

public class ArrowCreate extends SimpleShapeCreate

Hi Shirley_Gong

Thanks for your quick response :slight_smile:. I have added @keep annotation to all my custom annotation classes. Now the annotations are working fine in release mode.

If possible, please include this point in your documentation. So that it will helpful to anyone who uses custom tools.


Hi Ravi, thanks for your feedback. We’ll make sure this is mentioned in our documentation together with the upcoming release. Thanks.

1 Like