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

Compilation errors on iOS #11

Open
mipastgt opened this issue Feb 2, 2023 · 1 comment · May be fixed by #19
Open

Compilation errors on iOS #11

mipastgt opened this issue Feb 2, 2023 · 1 comment · May be fixed by #19

Comments

@mipastgt
Copy link

mipastgt commented Feb 2, 2023

I am currently trying to get Bonsai Core working in a multiplatform project with iOS which
is currently not supported by Bonsai. So I just copied over the sources into my project to
see whether this would be feasible. Formally I just had to add an actual implementation
for the "randomUUID" (see below) which was not a big issue because that is directly
available as a native function on iOS.

This setup worked out of the box for desktop and Android (both JVM) but compilation failed
with the following error for iOS.

> Task :shared:linkPodDebugFrameworkIosX64 FAILED
e: There are still 2 unbound symbols after generation of IR module <shared>:
Unbound public symbol IrConstructorPublicSymbolImpl: cafe.adriel.bonsai.core/BonsaiStyle.<init>|2287630319973089285[0]
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: cafe.adriel.bonsai.core/BonsaiStyle.copy|-7573618836952580526[0]

This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.

Do you have an idea how to fix that? I don't know where these two libraries should come
from because I have not declared any dependency on Bonsai in my Gradle setup. In order to verify this I renamed BonsaiStyle to BonsaiStyleX in my project so that it is different from any possible external reference but the error message remained the same now correctly referring to BonsaiStyleX.

It would be nice if you could support iOS directly because Bonsai works nicely so far on
the other platforms even with more than 2000 entries in the tree.

I tested this on macOS 12.6.3 Monterey, Kotlin 1.8.0, Compose 1.3.0

Michael

Actuals.kt:

package cafe.adriel.bonsai.core.util

import platform.Foundation.NSUUID

internal actual val randomUUID: String
    get() = NSUUID().UUIDString()
@mipastgt
Copy link
Author

mipastgt commented Feb 3, 2023

I have also reported this issue to JetBrains. JetBrains/compose-multiplatform#2694 but it may not be a problem at all if Bonsai is used as a library and not from the sources as in my test case. But I don't know for sure.

@DevNatan DevNatan linked a pull request Sep 27, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant