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

Issue when updating to kotlin 2.0 #78

Closed
vijimani17 opened this issue Jul 18, 2024 · 2 comments
Closed

Issue when updating to kotlin 2.0 #78

vijimani17 opened this issue Jul 18, 2024 · 2 comments

Comments

@vijimani17
Copy link

We are using MocKMP for unit testing in our project, we are currently migrating to kotlin 2.0 , while doing it we are seeing below the issue

C:\Users\vmanika\Trimbl\Instinct\chatCompanionApp\code\instinct-companion\composeApp\build\generated\ksp\android\androidUnitTestDebug\kotli
n\com\trimble\ttm\kmp\companion\repo\MockMessageFirebaseRepo.kt', 'C:\Users\vmanika\Trimbl\Instinct\chatCompanionApp\code\instinct-com
panion\composeApp\build\generated\ksp\android\androidUnitTestDebug\kotlin\com\trimble\ttm\kmp\companion\repo\MockTranslatorRepo.kt', '
C:\Users\vmanika\Trimbl\Instinct\chatCompanionApp\code\instinct-companion\composeApp\build\generated\ksp\android\androidUnitTestDebug
kotlin\com\trimble\ttm\kmp\companion\repo\MockUserDetailsRepo.kt', 'C:\Users\vmanika\Trimbl\Instinct\chatCompanionApp\code\instinct-companio
n\composeApp\build\generated\ksp\android\androidUnitTestDebug\kotlin\com\trimble\ttm\kmp\companion\usecase\MessageUseCaseTest_injectMocks.kt',
'C:\Users\vmanika\Trimbl\Instinct\chatCompanionApp\code\instinct-companion\composeApp\build\generated\ksp\andr
oid\androidUnitTestDebug\kotlin\com\trimble\ttm\kmp\companion\usecase\MockILanguagePreferenceUseCase.kt'

can be a part of only one module, but is listed as a source for both androidUnitTestDebug and commonTest, please check you -Xfragment-sources options.
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':composeApp:compileDebugUnitTestKotlinAndroid'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

" can be a part of only one module, but is listed as a source for both androidUnitTestDebug and commonTest, please check you -Xfragment-sources options."

I have code in only one module which is commonTest , But KSP is generating under "androidUnitTestDebug\kotlin\com\trimble\ttm\kmp\companion"

Does anyone faces the same issue , is there any work around is there

@flipper09112
Copy link

Someone already got a workArround?

Im facing the same problem. I need run to android for get the coverage report.

@SalomonBrys
Copy link
Member

Duplicates #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants