Error
[ +96 ms] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Execution failed for task ':app:compileDebugKotlin'.
[ ] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[ ] > Compilation error. See log for more details
[ ] * Try:
[ ] > Run with --debug option to get more log output.
[ ] > Run with --scan to get full insights.
[ ] * Exception is:
[ ] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugKotlin'.
[ ] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:149)
[ ] at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
[ ] at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
[ ] at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
[ ] at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
[ ] at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
[ ] at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
[ ] at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
[ ] at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
....
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
[ ] at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
[ ] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[ ] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[ ] ... 5 more
[ ] * Get more help at https://help.gradle.org
[ ] BUILD FAILED in 1m 12s
Solution
The key message is that the :app:compileDebugKotlin
task didn't complete successfully. This task is responsible for compiling Kotlin code in your Android app (when using Kotlin in a Flutter or Android project that relies on Gradle for builds).
Review the Kotlin code in your app's source files. Look for any syntax errors, incorrect type declarations, or other common coding mistakes. Even a small error like a missing parenthesis or a misspelled keyword can cause the compilation to fail. Pay special attention to recently added or modified Kotlin files as they are more likely to be the source of the problem.
Make sure all Kotlin classes and functions are properly defined and that there are no unresolved references to other classes, variables, or functions.