joreilly / PeopleInSpace

Kotlin Multiplatform sample with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, and Compose for Web clients along with Ktor backend.
Apache License 2.0
2.94k stars 259 forks source link

Usage of compose-ios #137

Closed alandoni closed 2 years ago

alandoni commented 2 years ago

Hi, can you help me? where can I find documentation or tutorials for compose-ios?

I tried to run ./gradlew compose-ios:iosDeployIPhone8Debug

but it threw the following error:

Field 'dataPathSize' is required for type with serial name 'org.jetbrains.compose.experimental.uikit.internal.DeviceData', but it was missing

joreilly commented 2 years ago

Hi,

Compose for iOS is at very experimental stage right now I believe. There was some discussion in following if it helps but I'm not surprised there's still issues. Could perhaps be related to XCode version for example installed. I'd suggest perhaps asking in kotlinlang slack "compose-ios" channel .

https://github.com/joreilly/PeopleInSpace/pull/127

joreilly commented 2 years ago

Also worth perhaps trying out JetBrains sample https://github.com/JetBrains/compose-jb/tree/master/experimental/examples/falling-balls-mpp

joreilly commented 2 years ago

I'm actually seeing issues here with the JetBrains samples and also PeopleInSpace.....suspecting it might be related to XCode update I did here recently....though getting different error here I think

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Unable to boot device because we cannot determine the runtime bundle.
alandoni commented 2 years ago

I was trying to find more informations about compose for ios but I couldn't, I know it's experimental but I just want to try and understand it

sadly my macbook is old and I can't update it anymore, hope it work with the latest version of big sur :(

thank you, your project is helping me a lot in my studies and curiosity!

TaehoonLeee commented 2 years ago

I faced the same issue. I solve this issue by updating xcode

alandoni commented 2 years ago

I tried in another macbook, with a newer version of xcode, it only changed the error, but still unable to compile :(

the error is:

e: Module "org.jetbrains.compose.runtime:runtime-saveable (org.jetbrains.compose.runtime:runtime-saveable-uikitx64)" has a reference to symbol androidx.compose.runtime/remember|-2215966373931868872[0]. Neither the module itself nor its dependencies contain such declaration.

TaehoonLeee commented 2 years ago

Would you like to change the Jetbrains compose version?

I'm not sure which version it is.

alandoni commented 2 years ago

I'm using 1.2.0-alpha01-dev683, the same the project uses

kotlinVersion=1.6.21
sqlDelightVersion=1.5.3
koinVersion=3.2.0
ktorVersion=2.0.1
composeVersion=1.2.0-beta01
composePluginVersion=1.2.0-alpha01-dev683
coroutinesVersion=1.6.1
TaehoonLeee commented 2 years ago

I'm sorry. I was mistaken because I used a different MacBook with Apple Sillicon.

I also had an error that looked like a version issue? on some MacBooks with Intel. I will share it when I solve it.

TaehoonLeee commented 2 years ago

@alandoni I solve the issue by adding below code in gradle.properties

kotlin.native.cacheKind=none

joreilly commented 2 years ago

fyi that I also just opened following PR to update compose ios version and also to switch to different simulator (had issues with iphone 8 here for some reason after updating to latest XCode) https://github.com/joreilly/PeopleInSpace/pull/141

joreilly commented 2 years ago

btw also seems to be working here without kotlin.native.cacheKind=none (running on M1 laptop)

alandoni commented 2 years ago

Thanks for the help, using that line in gradle.properties did the trick for me, I still need to check the changelog of compose, EditText is not working yet :(