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

Can't run commonTest on iOS simulator #3135

Closed
dima-avdeev-jb opened this issue May 8, 2023 · 6 comments
Closed

Can't run commonTest on iOS simulator #3135

dima-avdeev-jb opened this issue May 8, 2023 · 6 comments
Assignees
Labels
bug Something isn't working ios reproduced test

Comments

@dima-avdeev-jb
Copy link
Contributor

dima-avdeev-jb commented May 8, 2023

When trying to run test from commonMain in iOS simulator:

image

Test fails with error:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_MTLCommandBufferDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlCommandBuffer.o)
 ...

Slack discussion: https://kotlinlang.slack.com/archives/C0346LWVBJ4/p1682502923227539

@dima-avdeev-jb dima-avdeev-jb added bug Something isn't working test ios reproduced labels May 8, 2023
@dima-avdeev-jb dima-avdeev-jb self-assigned this May 8, 2023
@AKJAW
Copy link

AKJAW commented May 11, 2023

I've also came across this issue (Apple M1 Pro)

Here's my repository branch to reproduce this issue: AKJAW/Kotlin-Native-Implementations@03420e6

Besides the

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_MTLCommandBufferDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlCommandBuffer.o)
  "_OBJC_CLASS_$_MTLCompileOptions", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlUtil.o)
  "_OBJC_CLASS_$_MTLDepthStencilDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlDepthStencil.o)
...

I'm also getting a lot of warning for skia being built for a newer version:

e: /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.
output:
ld: warning: object file (/var/folders/y1/97tpgdnx58512tm7gcdq69r80000gn/T/konan_temp3073245421618510485/result.o) was built for newer iOS Simulator version (14.0) than being linked (9.0)
ld: warning: object file (/var/folders/y1/97tpgdnx58512tm7gcdq69r80000gn/T/included7250380580247839097/libskresources.a(libskresources.SkResources.o)) was built for newer iOS Simulator version (15.2) than being linked (9.0)
....
ld: warning: object file (/var/folders/y1/97tpgdnx58512tm7gcdq69r80000gn/T/included7250380580247839097/libskia.a(libexpat.xmlparse.o)) was built for newer iOS Simulator version (15.2) than being linked (9.0)
ld: warning: object file (/var/folders/y1/97tpgdnx58512tm7gcdq69r80000gn/T/included7250380580247839097/libskia.a(libexpat.xmlrole.o)) was built for newer iOS Simulator version (15.2) than being linked (9.0)
ld: warning: object file (/var/folders/y1/97tpgdnx58512tm7gcdq69r80000gn/T/included7250380580247839097/libskia.a(libexpat.xmltok.o)) was built for newer iOS Simulator version (15.2) than being linked (9.0)

To fix this issue, I needed to comment out the following libraries:

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

Here's the commit: AKJAW/Kotlin-Native-Implementations@29af6fd

@haydenkaizeta
Copy link

haydenkaizeta commented May 17, 2023

when

cocoapods {
    ..
    framework {
        ..
        isStatic = false

I also get this issue. Any timeline on when we can set this value to the default (false)?

@akiya-nagatsuka
Copy link

Related: #3178

@AKJAW
Copy link

AKJAW commented Jul 28, 2023

Are there any fixes / workarounds for this issue? Being unable to run iOS tests is a big issue for the Shared codebase

@pjBooms
Copy link
Contributor

pjBooms commented Jul 28, 2023

Yes it is fixed in the 1.5.0-beta01

@pjBooms pjBooms closed this as completed Jul 28, 2023
@pjBooms
Copy link
Contributor

pjBooms commented Jul 28, 2023

For previous versions look at this workaround: https://github.com/JetBrains/compose-multiplatform/pull/3378/files

msasikanth added a commit to msasikanth/twine that referenced this issue Aug 9, 2023
* Suppress name changed on override warning

* Rename RSS specific map functions

* Extract helper functions required for RSS feeds

* Trim feed link when parsing XML in iOS

* Add workaround for running tests on iOS simulator

JetBrains/compose-multiplatform#3135 (comment)

* Add iOS feed parser test for RSS feed

* Run code formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ios reproduced test
Projects
None yet
Development

No branches or pull requests

5 participants