dart
> Task :app:compileDebugKotlin FAILED
e: ...com\kl\analyze\ui\measure\AddBleDeviceFragmentDirections.kt: (3, 8): Unresolved reference: R
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugKotlin'.
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Caused by: org.gradle.api.GradleException: Compilation error. See log for more details
at org.jetbrains.kotlin.gradle.tasks.TasksUtilsKt.throwGradleExceptionIfError(tasksUtils.kt:22)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.run(GradleKotlinCompilerWork.kt:135)
原因是根据 AS的提示,升级AGP的版本后,将 AndroidManifest.mxl 中的 package="" 移到了build.gradle中了,导致编译报错。
解决方法:
将package="" 移回 AndroidManifest.mxl 中。