-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support androidNative target #812
Comments
The gradle file for K/N compilation does not have android native in its targets so you can not use it in K/N android projects. But you could maybe try to clone the repo, add the target and see if it compiles, but that is a bit experimental. Edit: that won't work, AtomicFU does not have the android native target either |
@SeekDaSky Seems like you are correct, there is support for it in kotlin multiplatform but these libraries are still missing it. I'm hoping for it to get added soon. |
What would be your use-case of using coroutines with androidNative target? |
@elizarov In this specific case it would be to standardize a communication bridge with Unity. iOS makes use but I also see a great possibility to write Native Libraries and hopefully make it more hard for people to reverse them since it would no longer be java code (This is still true with the common base, but it would take it all the way) |
+1 |
@dhakehurst Can you, please, elaborate a bit on what is your use-case for it? |
I would have thought obvious. ? Maybe something i miss understand about this target. |
@dhakehurst Why do you need to run with the NDK and not in ART as most apps do? |
Well, I don't "need" to. I want to. |
there are many articles discussing ART vs NDK. which states |
Supporting each target adds a considerable burden. We don't even have the infrastructure to test it. We'll have to create it. So that's why we need to understand what's the use-case. Why would you need it? If you use NDK you might be writing a game with Unity or some other game engine. Why would you need Kotlin coroutines there? |
I'd like to add my 2 cents here, just as a "Please do it!". Over the last year I've been asked why I use androidNative a few times by the Kotlin team (like here, here, ...) but it won't hurt to say it again. In this case I think the question "Why would you need Kotlin coroutines there?" is not hitting the right spot, because the
Now if there are many diverse reasons to use So... We kind of have all this on one side, and on the other, AtomicFU and Coroutines are missing a few lines in their build file, which gives a second-class citizen feeling (I'm still confused as to why 1.4.0 multiplatform has an |
I understand your pain, but adding |
why does Kotlin provide androidNative as a target, if the libraries will not support it? |
Support of |
Ok.
Community feedback:
I like it.
I need coroutine library support in order to play with it and better
evaluate it.
😉
…On Fri, 18 Sep 2020 at 11:46, Roman Elizarov ***@***.***> wrote:
Support of andoirdNative in Kotlin/Native is very experimental and
minimally tested. It might be fine to try it out, play with it. That's why
it is there, to let the community play with it and gather feedback, but it
is not fine for stable libraries like kotlinx.coroutines.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#812 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABK3WZNOGDASWFEYJ3RSN6DSGMUABANCNFSM4GCSMY3A>
.
|
In order for this addition to be made, we would need to rely on android emulators to give green light for the tests, or am I wrong @elizarov ? |
Right. To get started, we'll need somebody who works in this domain and knows ins-and-outs of working with Android Native code to contribute build scripts that can automatically run tests for the compiled code under an emulator. It is not our field of expertise, so there's not much we can help with. |
If anyone wants to give it a try I'm happy to give advices if needed. In the next months I'll try to work on it myself as well. |
A usecase for this is compiling your networking code to androidNative / ios as a shared lib and using the shared library from flutter. This way you don't have to deal with with serializing JVM/IOS classes to pass messages between flutter and the kotlin networking layer. |
@elizarov Would it be ok if you enable GitHub Actions on this repo (unless it already is) and on atomicfu as well, and then have someone contribute testing there for the Android NDK? I don't expect much or any difference compared to linuxX64 support when it comes to the code being compiled. Of course it'd need to be added to atomicfu first. |
@LouisCAD We don't use GitHub actions in Kotlin org. |
I know you use TeamCity, but why not start using both for this purpose? These things are not mutually exclusive AFAIK. Or provide us a little guidance to contribute to the TeamCity configuration? |
I have waited a long time for this 🎉. Thanks! |
Been trying to setup coroutines against
but it seems not to work with
but it does not resolve the dependencies, is this not working yet?
The text was updated successfully, but these errors were encountered: