[kapt] KotlinNullPointerException

Hi i’m having the following error on my build:

[kapt] An exception occurred: kotlin.KotlinNullPointerException

I already try:

kapt.use.worker.api=false
android.databinding.enableV2=true

In all modules that have kapt the kapt-plugin is the last import after android and kotlin.

I found some issues on the kotlin repository about this error, but accordingly to them this issue is already fixed on some older version. The problem happens only when i do upgrade my kotlin version from 1.3.70 to 1.4.31, any of the the 1.4.x versions the error happens

even with the command, the error happens:

./gradlew clean && ./gradlew assembleBrlDebug --no-build-cache --stacktrace

In the module :data i do have only the moshi using kapt

Stacktrace:

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:data:kaptBrlDebugKotlin’.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$3(ExecuteActionsTaskExecuter.java:186)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:268)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)

Someone could please help me?