3

Im following the template provided here by Jetbrains for adding compose to iOS and android and facing following issue:

FAILURE: Build completed with 4 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kmm:shared:compileCommonMainKotlinMetadata'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Internal compiler 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kmm:shared:linkDebugFrameworkIosArm64'.
> Compilation finished with errors

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

3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kmm:shared:linkDebugFrameworkIosX64'.
> Compilation finished with errors

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

4: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kmm:shared:linkDebugFrameworkIosSimulatorArm64'.
> Compilation finished with errors

I have added maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") in my repositories and having following configuration:

composeVersion="1.4.0"
agp="7.4.2"
kotlin="1.8.20"
kotlinCompilerExtensionVersion = "1.4.6"

Inside shared/build.gradle.kts

kotlin {
  ....
  sourceSets{
    val commonMain by getting{
       dependencies {
         ...
         implementation(compose.runtime)
         implementation(compose.foundation)
         implementation(compose.material)            
         @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
         implementation(compose.components.resources)
       }
       ....
    }
    ....
  }
  .....
}

Is there anything else apart from this I need to configure for using compose in iOS and Android.

3
  • 1
    I added isStatic = true inside framework config and is able to build the app now but as I added composable in shared Im getting following error now: ``` Showing Recent Messages Undefined symbol: _kfun:com.arindom.cocompose#GreetingView(){} Linker command failed with exit code 1 (use -v to see invocation). ``` Commented May 5, 2023 at 12:55
  • I have same error. Please write comment if you resolved this error! Commented May 9, 2023 at 9:07
  • 1
    This solution fixed the issue github.com/JetBrains/compose-multiplatform/issues/… Commented May 25, 2023 at 5:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.