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

Build error when adding mockmp to my project #83

Open
hantsy opened this issue Jan 8, 2025 · 2 comments
Open

Build error when adding mockmp to my project #83

hantsy opened this issue Jan 8, 2025 · 2 comments

Comments

@hantsy
Copy link

hantsy commented Jan 8, 2025

I followed the readme and docs/setup to add mockmp to my project, when run ./gradlew build -x test and got the following errors.

> Task :composeApp:compileDebugUnitTestKotlinAndroid FAILED
e: ..../composeApp/build/mockmp/commonTest/kotlin/mockmp.expect.kt:8:10 Expected mock has no actual declaration in module <composeApp_debugUnitTest> for JVM
e: ..../composeApp/build/mockmp/commonTest/kotlin/mockmp.expect.kt:11:10 Expected fake has no actual declaration in module <composeApp_debugUnitTest> for JVM
e: ..../composeApp/build/mockmp/commonTest/kotlin/mockmp.expect.kt:14:10 Expected injectMocks has no actual declaration in module <composeApp_debugUnitTest> for JVM

> Task :composeApp:compileReleaseUnitTestKotlinAndroid FAILED
e: ..../composeApp/build/mockmp/commonTest/kotlin/mockmp.expect.kt:8:10 Expected mock has no actual declaration in module <composeApp_releaseUnitTest> for JVM
e: ..../composeApp/build/mockmp/commonTest/kotlin/mockmp.expect.kt:11:10 Expected fake has no actual declaration in module <composeApp_releaseUnitTest> for JVM
e: ..../composeApp/build/mockmp/commonTest/kotlin/mockmp.expect.kt:14:10 Expected injectMocks has no actual declaration in module <composeApp_releaseUnitTest> for JVM

FAILURE: Build completed with 2 failures.

1: Task 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

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':composeApp:compileReleaseUnitTestKotlinAndroid'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

@franmontiel
Copy link

franmontiel commented Jan 8, 2025

Most probably the problem is happening because mockmp block must be declared after the kotlin block

@hantsy
Copy link
Author

hantsy commented Jan 11, 2025

I am sure I put the mockup to the end of the Gradle build script.

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

2 participants