Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 'debug' variant not found in KMM + Android project #388

Closed
alvr opened this issue May 26, 2023 · 6 comments
Closed

Android 'debug' variant not found in KMM + Android project #388

alvr opened this issue May 26, 2023 · 6 comments
Assignees
Labels
Bug Bug issue type S: untriaged Status: issue reported but unprocessed

Comments

@alvr
Copy link

alvr commented May 26, 2023

Describe the bug
When applying the plugin to the root project and specified subprojects, and using mergeWith in the default configuration, it throws and exception that the 'debug' Android variant was not found. Kover executes the tests that are in jvmTest source set (no commonTest yet), I suppose that when using mergeWith with the Android variant will execute also the tests in androidTest and commonTest.

Errors
Android build variant 'debug' was not found - it is impossible to add it to the default report

Expected behavior
Include the debug variant of Android in a KMM project.

Reproducer
The configuration of Kover is here, and the only variants the project has are 'debug', 'beta' and 'release'. The full project is in feature/kmm/stable.

Environment

  • Kover Gradle Plugin version: 0.7.0
  • Gradle version: 8.1.1
  • Kotlin project type: Kotlin/Multiplatform + Android
  • Coverage Toolset (if customized in build script): Kover
@alvr alvr added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels May 26, 2023
@sabufung30
Copy link

It looks like a duplicate of #362
Is there any workaround by the moment ? @shanshin

@alvr
Copy link
Author

alvr commented May 27, 2023

I saw that issue and tried to put all the Project.configure() inside afterEvalute and I get the same error.

@shanshin
Copy link
Collaborator

It looks like a duplicate of #362

Yes, most likely a duplicate

Is there any workaround by the moment ?

@alvr, @sabufung30, сould you change the configuration so that the kover plugin is applied only after the android plugin?

In this case, the Android plugin will create build variants before the Kover plugin starts searching for them.

@sabufung30
Copy link

sabufung30 commented May 31, 2023

@shanshin @alvr
I have put the configuration from subprojects into every single build.gradle.kts and it works. Build variants is not created when evaluating the configuration from subprojects

@shanshin
Copy link
Collaborator

@sabufung30 the order of applying of plugins is important. By moving the configuration from subprojects, you most likely changed the order and the Kover plugin started being applied after Android Gradle Plugin.
This is one of the solutions.

@shanshin
Copy link
Collaborator

Closing as a duplicate.
Follow the progress in correcting the error in the #362 task.

@shanshin shanshin closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: untriaged Status: issue reported but unprocessed
Projects
None yet
Development

No branches or pull requests

3 participants