Repository: <https://github.com/TheReprator/Khatab...
# multiplatform
a
Probably the most important piece of info missing here, is the actual reason it fails. Can you post the test result failure? it will be a stacktrace.
r
Copy code
@Andrew Reed my bad and thank u for your time, please find the stacktrace as follows, Executing tasks: [:shared:cleanIosSimulatorArm64Test, :shared:iosSimulatorArm64Test, --tests, dev.reprator.khatabook.data.dataSourceImpl.BasicTest.actualTest] in project /Users/vikramsingh/Desktop/code/kmp/Khatabook_KMP/shared


> Configure project :shared
Configuration 'iosArm64CompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See <https://github.com/gradle/gradle/issues/2298>
Run with --info for a stacktrace.
Configuration 'iosArm64TestCompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See <https://github.com/gradle/gradle/issues/2298>
Run with --info for a stacktrace.
Configuration 'iosSimulatorArm64CompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See <https://github.com/gradle/gradle/issues/2298>
Run with --info for a stacktrace.
Configuration 'iosSimulatorArm64TestCompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See <https://github.com/gradle/gradle/issues/2298>
Run with --info for a stacktrace.
Configuration 'iosX64CompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See <https://github.com/gradle/gradle/issues/2298>
Run with --info for a stacktrace.
Configuration 'iosX64TestCompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See <https://github.com/gradle/gradle/issues/2298>
Run with --info for a stacktrace.
Configuration 'jsCompileClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See <https://github.com/gradle/gradle/issues/2298>
Run with --info for a stacktrace.
Configuration 'jsTestCompileClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See <https://github.com/gradle/gradle/issues/2298>
Run with --info for a stacktrace.
> Task :shared:cleanIosSimulatorArm64Test UP-TO-DATE
> Task :shared:compileKotlinIosSimulatorArm64 FROM-CACHE
> Task :shared:iosSimulatorArm64ProcessResources NO-SOURCE
> Task :shared:iosSimulatorArm64MainKlibrary UP-TO-DATE
> Task :shared:compileTestKotlinIosSimulatorArm64
w: duplicate library name: org.jetbrains.kotlinx:kotlinx-coroutines-core
w: duplicate library name: org.jetbrains.kotlinx:atomicfu
w: duplicate library name: org.jetbrains.kotlinx:atomicfu-cinterop-interop
> Task :shared:linkDebugTestIosSimulatorArm64
w: duplicate library name: org.jetbrains.kotlinx:kotlinx-coroutines-core
w: duplicate library name: org.jetbrains.kotlinx:atomicfu
w: duplicate library name: org.jetbrains.kotlinx:atomicfu-cinterop-interop
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/q6/lnz5dwt94q91_qxxgfk52snw0000gn/T/konan_temp4579554472122251811/result.o) was built for newer iOS Simulator version (14.0) than being linked (9.0)
ld: warning: object file (/var/folders/q6/lnz5dwt94q91_qxxgfk52snw0000gn/T/included17025022097885768201/libskparagraph.a(libskparagraph.ParagraphCache.o)) was built for newer iOS Simulator version (15.2) than being linked (9.0)
ld: warning: object file (/var/folders/q6/lnz5dwt94q91_qxxgfk52snw0000gn/T/included17025022097885768201/libskparagraph.a(libskparagraph.ParagraphImpl.o)) was built for newer iOS Simulator version (15.2) than being linked (9.0)
ld: warning: object file (/var/folders/q6/lnz5dwt94q91_qxxgfk52snw0000gn/T/included17025022097885768201/libparticles.a(libparticles.SkReflected.o)) was built for newer iOS Simulator version (15.2) than being linked (9.0)
newer iOS Simulator version (15.2) than being linked (9.0)
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)
  "_OBJC_CLASS_$_MTLRenderPassDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlGpu.o)
      objc-class-ref in libskia.a(gpu.GrMtlOpsRenderPass.o)
  "_OBJC_CLASS_$_MTLRenderPipelineColorAttachmentDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlResourceProvider.o)
      objc-class-ref in libskia.a(gpu.GrMtlPipelineStateBuilder.o)
  "_OBJC_CLASS_$_MTLRenderPipelineDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlResourceProvider.o)
      objc-class-ref in libskia.a(gpu.GrMtlPipelineStateBuilder.o)
  "_OBJC_CLASS_$_MTLSamplerDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlSampler.o)
  "_OBJC_CLASS_$_MTLStencilDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlDepthStencil.o)
  "_OBJC_CLASS_$_MTLTextureDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlUtil.o)
      objc-class-ref in libskia.a(gpu.GrMtlGpu.o)
      objc-class-ref in libskia.a(gpu.GrMtlAttachment.o)
  "_OBJC_CLASS_$_MTLVertexDescriptor", referenced from:
      objc-class-ref in libskia.a(gpu.GrMtlPipelineStateBuilder.o)
ld: symbol(s) not found for architecture arm64
> Task :shared:linkDebugTestIosSimulatorArm64 FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared:linkDebugTestIosSimulatorArm64'.
> 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.
* Get more help at <https://help.gradle.org>
BUILD FAILED in 45s
4 actionable tasks: 2 executed, 1 from cache, 1 up-to-date
4:32:25 PM: Execution finished ':shared:cleanIosSimulatorArm64Test :shared:iosSimulatorArm64Test --tests "dev.reprator.khatabook.data.dataSourceImpl.BasicTest.actualTest"'.
a
Just a quick look over your build gradle, you have an odd setup for ios. you should be able to use the default sourcesets, this means you should get the iosTest for free. Looks like the setup for ios is not linking properly, does it work when you assemble? i.e. only breaks on your test but compiles fine?
r
Yes, when I run the ios app, it works perfectly
a
one second
think i know wht
why
r
Means?
a
hmm might be a bug with the gradle plugin, getting the same error. I thought it was related to you creating your own iosMain group, but doesnt seem to be
you can use ios() instead of defining all the architectures
then you will get iosMain for free but you will need to include iosSimulatorArm64Main seperately.
seems to be happening on all ios targets, not just arm64
looks when compiling for the test target of ios, it is importing in its dependancies twice.
the fact it is trying to include a metal library, then it must be gpu related so i think this could be a bug with jetbrains compose.
r
Thanks for your time @Andrew Reed
If there is any possible solution, do suggest me
a
I would recommend you raise a youtrack issue
k
@User i got the exact same issue did you raise a youtrack issue or found a workaround?
r
No @Kilian