[RESOLVED] ~I have a situation where the Desktop v...
# library-development
m
[RESOLVED] I have a situation where the Desktop version of an
expect fun
(part of our library implementation) is being called on Android builds, but only when our library is included as a dependency (in the "sample" app, it works fine)! I have no idea where to start to try to diagnose this problem. Any pointers would be greatly appreciated. If it matters, the function in question is a composable function:
Copy code
@Composable
internal expect fun PlatformRenderView(...)
Background: We're building a multiplatform declarative video compositing library that uses OpenGL and Metal under the hood, so we need expect/actual composable views for rendering. We release the library internally for now in our private GitHub Gradle Registry, but plan to open-source it in the future when we're happy with it's level of polish. It includes targets for Desktop, Android, and iOS. We have a "sample" folder alongside the "lib" folder (in
settings.gradle.kts
we have
include(":sample:composeApp")
and
include(":lib")
). When running the sample app, everything works fine on both Desktop and Android targets. However, when we publish the
lib
internally (using
maven-publish
) and try to use it as a dependency in another multiplatform project, the Desktop build works fine, but whenever we try to call a
expect
function on the Android built, it tries to use the desktop
actual
rather than the Android
actual
.
I'm guessing this is some kind of gradle configuration issue, but I'm not deeply experienced with gradle and have no idea where to start. Can anyone help point me in the right direction?
e
are you actually publishing the android artifacts?
m
I... think so? That's a good point. Let me check that they actually got published properly...
Well, that was the problem! 🤦‍♂️ I had added and tested that part and then—stashed my changes instead of committing 😳 Thank you for pointing me in the right direction. Greatly appreciated!