Guilherme Delgado
08/10/2023, 10:23 AM> Task :shared-ui-compose:compileKotlinIosSimulatorArm64 UP-TO-DATE
> Task :shared-ui-compose:linkPodDebugFrameworkIosSimulatorArm64 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
I’ve seen this thread and issues 2346 2694, but it seems latest compose/kotlin versions solved their issue.
I’m using:
Kotlin 1.9.0
Jetbrains Compose 1.5.0-dev1074 (tried also with 1.4.3)
Jetbrains Compose Compiler 1.5.0
Any hint?Guilherme Delgado
08/10/2023, 10:56 AMUndefined symbols for architecture arm64:
"_CTFontCollectionCreateFromAvailableFonts", referenced from:
SkFontMgr_Mac::SkFontMgr_Mac(__CTFontCollection const*) in libskia.a(fontmgr_mac_ct.SkFontMgr_mac_ct.o)
"_CTFontCollectionCreateMatchingFontDescriptors", referenced from:
(anonymous namespace)::SkCopyAvailableFontFamilyNames(__CTFontCollection const*) in
…….
"_kCTFontWeightTrait", referenced from:
create_descriptor(char const*, SkFontStyle const&) in libskia.a(fontmgr_mac_ct.SkFontMgr_mac_ct.o)
SkCTFontDescriptorGetSkFontStyle(__CTFontDescriptor const*, bool) in libskia.a(fontmgr_mac_ct.SkTypeface_mac_ct.o)
SkCTFontGetDataFontWeightMapping() in libskia.a(libskia.SkCTFont.o)å
"_kCTFontWidthTrait", referenced fårom:
create_descriptor(char const*, SkFontStyle const&) in libskia.a(fontmgr_mac_ct.SkFontMgr_mac_ct.o)
SkCTFontDescriptorGetSkFontStyle(__CTFontDescriptor const*, bool) in libskia.a(fontmgr_mac_ct.SkTypeface_mac_ct.o)
ld: symbol(s) not found for architecture arm64
FAILURE: Build failed with an exception.
Guilherme Delgado
08/10/2023, 11:01 AMisStatic = true
instead of false
made it work 🤔 why?Dima Avdeev
08/10/2023, 11:17 AMDima Avdeev
08/10/2023, 11:17 AMGuilherme Delgado
08/10/2023, 11:20 AMDima Avdeev
08/10/2023, 1:01 PMDima Avdeev
08/10/2023, 1:03 PMDima Avdeev
08/10/2023, 1:05 PMorg.gradle.logging.level=info
And attach Gradle logs to this threadGuilherme Delgado
08/10/2023, 1:07 PMpluginManagement {
includeBuild("build-logic")
repositories {
google()
gradlePluginPortal()
mavenCentral()
maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
maven("<https://androidx.dev/storage/compose-compiler/repository/>")
}
}
composeMultiplatformCompiler = "1.5.0"
composeMultiplatform = "1.5.0-dev1074"
jetbrains-compose-multiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" }
plugins {
...
alias(libs.plugins.jetbrains.compose.multiplatform)
}
compose {
kotlinCompilerPlugin.set(libs.versions.composeMultiplatformCompiler)
// kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.9.0")
}
Guilherme Delgado
08/10/2023, 1:08 PM1.5.0-dev1074
to 1.5.0-beta01
it will failGuilherme Delgado
08/10/2023, 1:08 PM```* What went wrong:
An exception occurred applying plugin request [id: 'org.jetbrains.compose', version: '1.5.0-beta01']
> Failed to apply plugin 'org.jetbrains.compose'.
> class org.jetbrains.compose.ComposeMultiplatformBuildService$Inject cannot be cast to class org.jetbrains.compose.ComposeMultiplatformBuildService (org.jetbrains.compose.ComposeMultiplatformBuildService$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @3380048a; org.jetbrains.compose.ComposeMultiplatformBuildService is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @2ce91950)```
Dima Avdeev
08/10/2023, 1:17 PMGuilherme Delgado
08/10/2023, 1:18 PMGuilherme Delgado
08/10/2023, 2:32 PMalexey.tsvetkov
08/10/2023, 3:55 PMorg.jetbrains.compose:compose-gradle-plugin
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(libs.gradle.android.tools)
classpath(libs.gradle.kotlin)
classpath(libs.gradle.kotlin.serialization)
classpath(libs.gradle.kotlin.serialization)
classpath("org.jetbrains.compose:compose-gradle-plugin:1.5.0-beta01")
}
}
alexey.tsvetkov
08/10/2023, 4:06 PMbuildscript
or using plugins DSL). That way you can be sure that there are no classloding issuesGuilherme Delgado
08/10/2023, 4:07 PMid("org.jetbrains.compose")
in this case?Guilherme Delgado
08/10/2023, 4:07 PMalexey.tsvetkov
08/10/2023, 4:15 PMso basically specifying the version in the classpath and then in each build.gradle.kts only adding• Yesin this case?id("org.jetbrains.compose")
alexey.tsvetkov
08/10/2023, 4:16 PM(it worked)@Guilherme Delgado just to clarify: do you mean that everything builds with
1.5.0-beta01
?Guilherme Delgado
08/10/2023, 4:17 PMalexey.tsvetkov
08/10/2023, 4:18 PMGuilherme Delgado
08/10/2023, 4:18 PMGuilherme Delgado
08/10/2023, 4:18 PMGuilherme Delgado
08/10/2023, 4:18 PMGuilherme Delgado
08/10/2023, 4:19 PMGuilherme Delgado
08/10/2023, 4:19 PMGuilherme Delgado
08/10/2023, 4:19 PMDima Avdeev
08/10/2023, 4:55 PMGuilherme Delgado
08/10/2023, 4:58 PMGuilherme Delgado
08/10/2023, 5:17 PMLibrary not loaded: @rpath/Shared.framework/Shared
Referenced from: <284B6553-3E94-3B15-8954-7FB0F1D0D8E5> /Users/USER/Library/Developer/Xcode/UserData/Previews/Simulator Devices/979993FB-71EB-4605-82CE-1B5137A6F788/data/Containers/Bundle/Application/1B2FEE8E-D276-4BA9-AB02-89943E4FF910/iosApp.app/iosApp
Reason: tried: '/Users/guilhermedelgado/Library/Developer/Xcode/DerivedData/iosApp-bluqxibulbhynkcxkkrpnzhenswq/Build/Intermediates.noindex/Previews/iosApp/Products/Debug-iphonesimulator/Shared.framework/Shared' (no such file), '/Users/guilhermedelgado/Library/Developer/Xcode/UserData/Previews/Simulator Devices/979993FB-71EB-4605-82CE-1B5137A6F788/data/Containers/Bundle/Application/1B2FEE8E-D276-4BA9-AB02-89943E4FF910/iosApp.app/Frameworks/Shared.framework/Shared' (no such file), '/Users/guilhermedelgado/Library/Developer/Xcode/UserData/Previews/Simulator Devices/979993FB-71EB-4605-82CE-1B5137A6F788/data/Containers/Bundle/Application/1B2FEE8E-D276-4BA9-AB02-89943E4FF910/iosApp.app/Frameworks/
(terminated at launch; ignore backtrace)
I remember in the past I had to make isStatic = false
to have SwiftUi Previews. But now it’s false by default and it’s failing 😓Guilherme Delgado
08/13/2023, 6:14 PMGuilherme Delgado
08/13/2023, 6:18 PMPreview with Compose in SwiftUI not works. We planning to do separate functionallity for preview of Compose part on iOS, but it is not a first priority Issue.@Dima Avdeev It’s working 😅 I can see it!