https://kotlinlang.org logo
Title
h

Hasan Nagizade

05/15/2023, 3:55 PM
any other decent socket io library to use instead of this? https://github.com/icerockdev/moko-socket-io the install guide is incomplete
a

alex009

05/15/2023, 5:19 PM
hi. what problems you have with install? did you try samples in repo?
h

Hasan Nagizade

05/15/2023, 5:25 PM
Hi in here pod doesn't have
onlyLink
. Getting error
Cannot find a parameter with this name: onlyLink
when I remove that
onlyLink
and sync gradle I am getting this error
putting dependency in podfile -> doing pod install -> and then doing gradle sync again getting same error.
it's basically impossible to install the library properly
z

zt

05/16/2023, 3:10 AM
ktor supports sockets
h

Hasan Nagizade

05/16/2023, 4:35 AM
yeah but socket io and websockets are not the same
you can add dependency with JetBrains plugin:
cocoapods {
        ...

        // 11.0 minimal supported
        ios.deploymentTarget = "11.0"
        
        // add native dependency
        pod(name = "mokoSocketIo") {
            this.source = this.git(url = "<https://github.com/icerockdev/moko-socket-io.git>") {
                this.tag = "release/0.3.0"
            }
        }
    }
but at now with this way you got additional cinterop generation that not needed for your project
h

Hasan Nagizade

05/17/2023, 4:30 AM
this part solved now
commonMainApi("dev.icerock.moko:socket-io:0.3.0")
this line gives another error
and thank you very much for updating library readme
a

alex009

05/17/2023, 4:31 AM
at now this library not updated for support arm64 simulator 😞
h

Hasan Nagizade

05/17/2023, 4:31 AM
is there anything that I can do? my project heavily relies on socket io
a

alex009

05/17/2023, 4:34 AM
you can fork library and add new target, then send PR and i will publish update to maven central
https://github.com/icerockdev/moko-socket-io/blob/6ce28f4da76f409cfc833d912992397ca0d62df4/socket-io/build.gradle.kts#L25 here now only
ios
-
iosArm64
,
iosX64
. need to add
iosSimulatorArm64
, then add
iosSimulatorArm64Main
dependency to
iosMain
sourceset and test that
./gradlew build publishToMavenLocal
run successful
also you can setup config like in other moko libs - with moko-gradle-plugin, this will be better. https://github.com/icerockdev/moko-geo/pull/32/files here sample
h

Hasan Nagizade

05/17/2023, 7:52 AM
Forked library but getting some strange errors
a

alex009

05/17/2023, 7:53 AM
show please
h

Hasan Nagizade

05/17/2023, 7:54 AM
Screenshot 2023-05-17 at 11.53.57.png
is my jdk old or library uses older version?
Screenshot 2023-05-17 at 11.54.28.png
Upgrading gradle wrapper gives whole lot of other errors
try 1.8
h

Hasan Nagizade

05/17/2023, 7:56 AM
I have openjdk 19.0.2 2023-01-17
a

alex009

05/17/2023, 7:57 AM
it's too new for this config as you can see 🙂
h

Hasan Nagizade

05/17/2023, 7:57 AM
so I need older jdk?
wouldn't it be better to update project jdk?
a

alex009

05/17/2023, 7:57 AM
yes. or need to update gradle setup in project
if you can update - do it please 🙂
h

Hasan Nagizade

05/17/2023, 8:13 AM
Upgrading gradle gives whole bunch of other errors such as
I guess it will be simpler to just copy the library into project and use it like that 🙂
a

alex009

05/17/2023, 8:20 AM
i think this just show that kotlin version not support this gradle. update kotlin
h

Hasan Nagizade

05/17/2023, 8:35 AM
new error
Execution failed for task ':sample:android-app:processDebugMainManifest'.
Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @63f0257b
a

alex009

05/17/2023, 8:39 AM
some strange. maybe need to update AGP version?
h

Hasan Nagizade

05/17/2023, 8:43 AM
after all the updates make project works fine 🙂
is this looking fine?
./gradlew build publishToMavenLocal
is giving this error
> Task :cocoapodBuildMokoSocketIoIphoneosArm64 FAILED
https://kotlinlang.slack.com/archives/C3PQML5NU/p1684313341865469?thread_ts=1684166148.239489&amp;cid=C3PQML5NU before build you should install pods -
(cd sample/ios-app && pod install)
h

Hasan Nagizade

05/17/2023, 8:51 AM
just need to add
iosSimulatorArm64
?
a

alex009

05/17/2023, 8:51 AM
yes. and in sourcesets add dependency
iosSimulatorArm64Main -> iosMain
h

Hasan Nagizade

05/17/2023, 9:02 AM
looks fine?
Screenshot 2023-05-17 at 13.04.37.png
getting this error
a

alex009

05/17/2023, 9:10 AM
show full log please
https://kotlinlang.slack.com/archives/C3PQML5NU/p1684314283816729?thread_ts=1684166148.239489&amp;cid=C3PQML5NU ios main already have dependency to commonMain, you should not add it here
h

Hasan Nagizade

05/17/2023, 9:11 AM
but the rest is fine?
a

alex009

05/17/2023, 9:12 AM
yes
h

Hasan Nagizade

05/17/2023, 9:12 AM
it's the full log there's no other error just warnings
a

alex009

05/17/2023, 9:12 AM
better to first get iosMain and then get iosSimulator and add depeendency
h

Hasan Nagizade

05/17/2023, 9:13 AM
moko-socket-io/socket-io/build.gradle.kts' line: 126
a

alex009

05/17/2023, 9:14 AM
logs file 🙂
h

Hasan Nagizade

05/17/2023, 9:15 AM
it's in the terminal output of this
./gradlew build publishToMavenLocal
I can copy full text here if you want
a

alex009

05/17/2023, 9:16 AM
./gradlew build publishToMavenLocal > logs.txt
and then send this
logs.txt
here 🙂
h

Hasan Nagizade

05/17/2023, 9:16 AM
oh okay this is nicer 🙂
here's the logs
a

alex009

05/17/2023, 9:18 AM
./gradlew build publishToMavenLocal 2> errors.txt
h

Hasan Nagizade

05/17/2023, 9:19 AM
errors.txt
a

alex009

05/17/2023, 9:20 AM
./gradlew build publishToMavenLocal --stacktrace 2> errors.txt
better just run
./gradlew build publishToMavenLocal --scan
and send me link)
h

Hasan Nagizade

05/17/2023, 9:23 AM
a

alex009

05/17/2023, 9:28 AM
update mobile multiplatform gradle plugin to 0.14.2
h

Hasan Nagizade

05/17/2023, 9:32 AM
logs2.txt
a

alex009

05/17/2023, 9:33 AM
in this logs no problems 🙂 better show gradle scan
h

Hasan Nagizade

05/17/2023, 9:34 AM
a

alex009

05/17/2023, 9:35 AM
just update dependencies 🙂 error show that used kotlinx-serialization not support ios simulator arm64
h

Hasan Nagizade

05/17/2023, 9:58 AM
Added dummy actual classes to here and now maven local build is successful. what next?
a

alex009

05/17/2023, 11:47 AM
i will publish update today
h

Hasan Nagizade

05/17/2023, 11:54 AM
thanks please let me know once it's done
a

alex009

05/17/2023, 3:43 PM
@Hasan Nagizade update released
h

Hasan Nagizade

05/17/2023, 3:58 PM
Thank you 👍
@alex009 I am now getting new error
ld: framework not found mokoSocketIo
in my project. Here's the gradle setup. Would this go away if I will use your cocoapods plugin or is it something different?
this is in the shared module
build.gradle
updated this.tag = "release/0.4.0" but still same error
a

alex009

05/18/2023, 4:21 PM
so i will test cocoapods integration with JB cocoapods later
h

Hasan Nagizade

05/18/2023, 4:54 PM
JB Cocoapods integration is not working. It will be better to enable Starscream arm64 compatability. Because if you are compiling with iOS Simulator it will fail
a

alex009

05/20/2023, 8:55 PM
@Hasan Nagizade so all works as i see - https://github.com/Alex009/moko-socket-io-sample i test on ios simulator arm64 and on android emulator
h

Hasan Nagizade

05/22/2023, 8:18 AM
thank you @alex009