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()
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.
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
BonsaiStyletoBonsaiStyleXin my project so that it is different from any possible external reference but the error message remained the same now correctly referring toBonsaiStyleX.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: