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

Unresolved reference when import a swift class/function inside kotlin fun #38

Open
santyas opened this issue Aug 8, 2024 · 2 comments

Comments

@santyas
Copy link

santyas commented Aug 8, 2024

Hello!

I'm using swiftklib 0.6.3 & k 2.0 and following this video I cant access to any method from a basic swift example.

Error message:
error-kotlin-native

Swift code:
swift

And My config
gradle-create
gradle-target

Thank you so much!

@658jjh
Copy link

658jjh commented Oct 24, 2024

I do the same as this video too but got this error:

* What went wrong:
Execution failed for task ':composeApp:cinteropGenIosArm64'.
> Could not resolve all files for configuration ':composeApp:iosArm64CInterop'.
   > Could not resolve androidx.core:core-animation:1.0.0.
     Required by:
         project :composeApp
      > No matching variant of androidx.core:core-animation:1.0.0 was found. The consumer was configured to find a library for use during 'kotlin-cinterop', with the library elements 'cinterop-klib', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64', attribute 'org.jetbrains.kotlin.platform.type' with value 'native' but:
          - Variant 'libraryVersionMetadata':
              - Incompatible because this component declares documentation for use during 'library-version-metadata' and the consumer needed a library for use during 'kotlin-cinterop'
              - Other compatible attributes:
                  - Doesn't say anything about its elements (required them with the library elements 'cinterop-klib')
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                  - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_arm64')
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'native')
          - Variant 'releaseVariantReleaseApiPublication' declares a library for use during compile-time:
              - Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, with the library elements 'cinterop-klib'
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                  - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_arm64')
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'native')
          - Variant 'releaseVariantReleaseRuntimePublication' declares a library for use during runtime:
              - Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, with the library elements 'cinterop-klib'
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                  - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_arm64')
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'native')
          - Variant 'sourcesElements' declares a component for use during runtime:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its elements (required them with the library elements 'cinterop-klib')
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                  - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_arm64')
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'native')

Look like it try to gen from the kotlin source instead :/

@santyas
Copy link
Author

santyas commented Oct 24, 2024

I solved it by creating a new project. I haven't really found where the problem was, it just works.

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