Code Monkey home page Code Monkey logo

Comments (9)

Reedyuk avatar Reedyuk commented on August 23, 2024 1

Sounds very familiar, i recall having a similar issue before and cant remember what i did the fix it. Let me have a think about it.

from blue-falcon.

Reedyuk avatar Reedyuk commented on August 23, 2024

What version of Gradle and also kotlin?

Looks like the coroutines library used is of 1.3.70 and needs to be changed to a 1.4 one.

e: Could not find "/Users/lneumann/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosarm64/1.3.8/ab1f410af27e33b328b0e7b3b75875953822e9eb/kotlinx-coroutines-core.klib" in [/Users/lneumann/Projekte/SteigtUm/blue-falcon/examples/KotlinMP/iosApp, /Users/lneumann/.konan/klib, /Users/lneumann/.konan/kotlin-native-prebuilt-macos-1.4.10/klib/common, /Users/lneumann/.konan/kotlin-native-prebuilt-macos-1.4.10/klib/platform/ios_arm64].

from blue-falcon.

ln-12 avatar ln-12 commented on August 23, 2024

Ok, that helped. Now there's another error I can't get rid of. I also had this one in my own project, that's why I wanted to try out the example to see if I'm doing wrong:


> Task :app:compileKotlinIos FAILED
e: /Users/<some path>/blue-falcon/examples/KotlinMP/app/src/iosMain/kotlin/sample/scan.kt: (3, 1): @Throws must have non-empty class list

FAILURE: Build failed with an exception.

from blue-falcon.

ln-12 avatar ln-12 commented on August 23, 2024

If I remove the @Throws annotation, Xcode builds the project and runs the app. It seems to work fine at first sight, but in the console XCode outputs: Unknown error happened.

from blue-falcon.

Reedyuk avatar Reedyuk commented on August 23, 2024

Try kotlin.native.Throws instead?

from blue-falcon.

ln-12 avatar ln-12 commented on August 23, 2024

Nope. Either I put the @Throws annotation above the method and get @Throws must have non-empty class list or I leave it out and get Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError. It is considered unexpected and unhandled instead. Program will be terminated.

from blue-falcon.

ln-12 avatar ln-12 commented on August 23, 2024

I figured it out now. I can't call scan() directly from Swift. Instead, I need to use your MainCompat approach like shown here. Maybe you could explicitly state that in the documentation? And I also see that @UseExperimental is deprecated and the NSBluetoothAlwaysUsageDescription is missing, so I think updating the example would also be a good idea.

from blue-falcon.

Reedyuk avatar Reedyuk commented on August 23, 2024

Ah, yes that was it.
Could you possibly do a PR with the changes?

Thanks

from blue-falcon.

ln-12 avatar ln-12 commented on August 23, 2024

I found that by using the coroutine native-mt dependency we can completely get rid of MainCompat. Everything should be up to date now.

from blue-falcon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.