Coverity build Error

I am receiving coverity build error below: FAILURE:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task 'task name'.
> java.lang.NullPointerException (no error message)

optimised build passes but when I enable the coverity flag getting the above errors

could someone help on this issue?

Did you follow the suggestions in the error message that you didn’t paste along how to get more informatin?
If no, why not?
If yes, why don’t you provide that additional information?
Especially the --stacktrace or optimally a build --scan URL if possible.