Hello everyone :wave: I need your help with kmmbri...
# touchlab-tools
r
Hello everyone 👋 I need your help with kmmbridge, I have the basic configuration of the plugin, I can generate the iOS version (and publish it) but the tasks to upload the Android version (
publishKotlinMultiplatformPublicationToGitHubPackagesRepository
,
PublishAndroidDebugPublicationToGitHubPackagesRepository
and
PublishAndroidReleasePublicationToGitHubPackagesRepository
) are not found within the gradle tasks .
kmmBridge = "1.0.1"
kotlin = 1.9.24
k
You can't publish to GitHub Packages if you're running locally unless you supply the repo and access info (token) directly. When running the GA workflow, the workflow can grab that info from the workflow context. See code. The task you're trying to run is set up as the maven repo is added, but that doesn't happen without the GitHub repo and access info: https://github.com/touchlab/KMMBridge/blob/ecfdbf7099147d048f1eaf748bbff816716c503b/kmmbridge/src/main/kotlin/BuildFileHelper.kt#L37 See the GA workflow code at https://github.com/touchlab/KMMBridgeSPMQuickStart/blob/e893a09d9796283f70f34b7cc964f00fb439c074/.github/workflows/KMMBridge-Android-iOS-publish.yml#L50
Copy code
./gradlew publish[etc]PublicationToGitHubPackagesRepository [yada yada] -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} -PGITHUB_REPO=${{ github.repository }}
r
I understand, but, in my repository I have module 1 -> android module 2 -> android shared core -> kmp.. GA wants to execute these tasks in my module 1, module 2... etc.
k
What's your publish config for the Android targets?
In the KMMBridge template, it looks like this:
Copy code
androidTarget {
    publishAllLibraryVariants()
}
If you're not telling KMP to publish, say, debug, then it won't create the debug publishing task. Off-hand, I'm not sure what happens is you simply exclude any publishing variant info, like so:
Copy code
androidTarget()
It might default to release, but also might default to nothing (which is what I'd guess it does, but not sure).
r
shared-core.gradle.kts... kotlin { }
publishAllLibraryVariants
insteand of
publishLibraryVariants
? 🥲
k
That expects a list of variants.
publishAllLibraryVariants
insteand of
publishLibraryVariants
?
Yeah, looks like that's the issue.
r
I apply the change and run GA 🤞
k
Good luck!
r
You saved my day bro. Thanks for the support.
👍 1