DroidKaigi / conference-app-2024

The Official Conference App for DroidKaigi 2024
Apache License 2.0
410 stars 200 forks source link

Bug, Build fails to kover on just compile #485

Closed Pluu closed 2 weeks ago

Pluu commented 4 weeks ago

This appears to be a configuration issue with “kover”. Running is fine, but builds like “Make Project” fail.

a

I don't know kover, so I'm hoping someone can help me with this.

Build file '/Users/pluu/SampleProject/conference-app-2024/app-android/build.gradle.kts' line: 4

An exception occurred applying plugin request [id: 'droidkaigi.primitive.kover.entrypoint']
> Failed to apply plugin 'org.jetbrains.kotlinx.kover'.
   > Cannot run Project.afterEvaluate(Action) when the project is already evaluated.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.9/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 3s
5 actionable tasks: 1 executed, 4 up-to-date
Configuration cache entry stored.
Corvus400 commented 3 weeks ago

Even if Kover is commented out, it seems that there are other problems that are not related to Kover that need to be addressed as well. :thinking:

e: file:///Users/todayamar/Repository/conference-app-2024/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched/ui/IosComposeAdapter.kt:62:5 Cannot access class 'androidx.compose.ui.Modifier'. Check your module classpath for missing or conflicting dependencies.

スクリーンショット 2024-08-22 10 56 55

Corvus400 commented 3 weeks ago

Incidentally, even in last year's project, if Kover was not commented out, Build failed immediately. So I commented out Kover and Rebuild Project and eventually Build Failed. Is it sufficient to solve only the Kover issue in this Issue? 🤔 (Of course, “commenting out Kover” does not = “solution to the problem”.) Or is the same situation as last year (i.e., Build Failed at the end) the solution? 🤔

スクリーンショット 2024-08-22 11 56 23

Aniokrait commented 3 weeks ago

I found three problems related to “Make Project” failure. The first two problems are as @Pluu and @Corvus400 said. The third one is gradle caching error. It shows error below.

3 problems were found storing the configuration cache.
- Task `:core:data:kspKotlinIosArm64` of type `com.google.devtools.ksp.gradle.KspTaskNative`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.9/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
- Task `:core:data:kspKotlinIosSimulatorArm64` of type `com.google.devtools.ksp.gradle.KspTaskNative`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.9/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
- Task `:core:data:kspKotlinIosX64` of type `com.google.devtools.ksp.gradle.KspTaskNative`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.9/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

Each one of them results in build failure, but the cause looks like independent respectively. So, how about that we create other issues for "cannot access Modifier problem" and "gradle cache problem"?

[!NOTE]
I have investigated proposed solution, I could have not verified thoroughly though.

  1. Kover problem could be solved by fixing KoverEntryPointPlugin like this.

    this@subprojects.beforeEvaluate { // wrap with beforeEvaluate
    this@subprojects.pluginManager.apply(koverPlugin)
    }

    Though Kover doesn't output report when project is built, ./gradlew koverHtmlReportDevDebug makes report.

  2. Modifier problem could be solved by changing module name of core:ui like core:droidkaigiui It seems to be kotlin bug (KT-66568).

  3. Gradle cache problem could be solved fixing KmpKtorfitPlugin. I've checked these code suppress gradle cache error. (The reason message was brought from KmpPlugin, so it might be reconsidered to proper one.)

    
    tasks.withType<KspTaskNative>().configureEach {
    notCompatibleWithConfigurationCache("Configuration chache not supported for a system property read at configuration time")
    
    }
    tasks.withType<KotlinNativeLink>().configureEach {
    notCompatibleWithConfigurationCache("Configuration chache not supported for a system property read at configuration time")

}

Corvus400 commented 2 weeks ago

@Aniokrait Thank you for even including a specific solution! 🙇

So, how about creating separate issues for the “Modifier inaccessibility issue” and the “Gradle cache issue”?

Yes, let's address them with that policy!

@Pluu @takahirom I think it's an urgent issue, so I'll create an Issue to deal with it now! 🫡