Sample code here. Without this change, the project builds. Looks like there are two things:
- Stubs compilation failing
- Moshi Kotlin Codegen plugin not running
Build output:
ERROR: /Users/p/Code/examples/bazel-kt-databinding-crash/app/BUILD:32:22: KotlinCompile //app:app_lib-kotlin { kt: 9, java: 0, srcjars: 1 } for darwin_arm64 failed: (Exit 1): build failed: error executing command bazel-out/host/bin/external/io_bazel_rules_kotlin/src/main/kotlin/build '--flagfile=bazel-out/darwin_arm64-fastbuild/bin/app/app_lib-kotlin-kt-java.jar-0.params'
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
app/src/main/java/com/example/databinding/Api.kt:5:19: error: unresolved reference: UpdatesJsonAdapter
fun dealWith(uja: UpdatesJsonAdapter) {}
^
Jan 01, 2022 10:20:03 PM worker request 0
SEVERE: Compilation failure: compile phase failed:
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
/private/var/tmp/_bazel_p/a48d838470da09ddcc3c8b96c3b3efad/execroot/__main__/app/src/main/java/com/example/databinding/Api.kt:5:19: error: unresolved reference: UpdatesJsonAdapter
fun dealWith(uja: UpdatesJsonAdapter) {}
^
io.bazel.kotlin.builder.toolchain.CompilationStatusException: compile phase failed:
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: not a statement
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
error: /private/var/folders/71/0r_ylvb13vv2my1_676sx1gm0000gn/T/pwd13981900757377101490/_kotlinc/app-app_lib-kotlin_jvm/generated_java_sources/com/example/databinding/com_example_databinding_Binding_Adapter_Stub.java:22: error: ';' expected
DataBindingPagedListAdapter<T>.setPagedItems(view, itemLayout, itemContext, items);
^
/private/var/tmp/_bazel_p/a48d838470da09ddcc3c8b96c3b3efad/execroot/__main__/app/src/main/java/com/example/databinding/Api.kt:5:19: error: unresolved reference: UpdatesJsonAdapter
fun dealWith(uja: UpdatesJsonAdapter) {}
^
at io.bazel.kotlin.builder.toolchain.CompilationTaskContext.executeCompilerTask(CompilationTaskContext.kt:130)
at io.bazel.kotlin.builder.toolchain.CompilationTaskContext.executeCompilerTask$default(CompilationTaskContext.kt:114)
at io.bazel.kotlin.builder.tasks.jvm.Compilation_taskKt$runPlugins$1.invoke(compilation_task.kt:182)
at io.bazel.kotlin.builder.tasks.jvm.Compilation_taskKt$runPlugins$1.invoke(compilation_task.kt:166)
at io.bazel.kotlin.builder.toolchain.CompilationTaskContext.execute(CompilationTaskContext.kt:148)
at io.bazel.kotlin.builder.toolchain.CompilationTaskContext.execute(CompilationTaskContext.kt:140)
at io.bazel.kotlin.builder.tasks.jvm.Compilation_taskKt.runPlugins(compilation_task.kt:166)
at io.bazel.kotlin.builder.tasks.jvm.KotlinJvmTaskExecutor.execute(KotlinJvmTaskExecutor.kt:54)
at io.bazel.kotlin.builder.tasks.KotlinBuilder.executeJvmTask(KotlinBuilder.kt:232)
at io.bazel.kotlin.builder.tasks.KotlinBuilder.build(KotlinBuilder.kt:130)
at io.bazel.kotlin.builder.tasks.CompileKotlin.invoke(CompileKotlin.kt:27)
at io.bazel.worker.PersistentWorker$compileWork$2$result$1.invoke(PersistentWorker.kt:96)
at io.bazel.worker.PersistentWorker$compileWork$2$result$1.invoke(PersistentWorker.kt:94)
at io.bazel.worker.WorkerContext$TaskContext.resultOf(WorkerContext.kt:128)
at io.bazel.worker.WorkerContext.doTask(WorkerContext.kt:156)
at io.bazel.worker.PersistentWorker$compileWork$2.invokeSuspend(PersistentWorker.kt:94)
at io.bazel.worker.PersistentWorker$compileWork$2.invoke(PersistentWorker.kt)
at io.bazel.worker.PersistentWorker$compileWork$2.invoke(PersistentWorker.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at io.bazel.worker.PersistentWorker.compileWork(PersistentWorker.kt:93)
at io.bazel.worker.PersistentWorker.access$compileWork(PersistentWorker.kt:45)
at io.bazel.worker.PersistentWorker$start$1$1$1$1$2$1.invokeSuspend(PersistentWorker.kt:71)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)Target //app:app_lib failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 31.103s, Critical Path: 4.31s
INFO: 7 processes: 2 internal, 4 darwin-sandbox, 1 worker.
FAILED: Build did NOT complete successfully
bug