Skip to content
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

Multiplatform publishing not working on 3.0.0-beta02 & 3.0.0-beta03 #280

Closed
frett opened this issue Jul 21, 2021 · 8 comments
Closed

Multiplatform publishing not working on 3.0.0-beta02 & 3.0.0-beta03 #280

frett opened this issue Jul 21, 2021 · 8 comments

Comments

@frett
Copy link

frett commented Jul 21, 2021

When I update my multiplatform dependencies to use the new versions of splitties from maven central I get the following build error:

* What went wrong:
Execution failed for task ':compileKotlinIos'.
> Could not resolve all files for configuration ':iosCompileKlibraries'.
   > Could not find com.louiscad.splitties:bitflags-iosx64:3.0.0-beta02.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/louiscad/splitties/bitflags-iosx64/3.0.0-beta02/bitflags-iosx64-3.0.0-beta02.pom
       - https://repo.maven.apache.org/maven2/com/louiscad/splitties/bitflags-iosx64/3.0.0-beta02/bitflags-iosx64-3.0.0-beta02.pom
     Required by:
         project : > com.louiscad.splitties:splitties-bitflags:3.0.0-beta02

it appears that the main module found here has the following invalid relative url defined in it:

    {
      "name": "iosX64ApiElements-published",
      "attributes": {...},
      "available-at": {
        "url": "../../bitflags-iosx64/3.0.0-beta03/bitflags-iosx64-3.0.0-beta03.module",
        "group": "com.louiscad.splitties",
        "module": "bitflags-iosx64",
        "version": "3.0.0-beta03"
      }
    },
@LouisCAD
Copy link
Owner

Can you show how you declared the dependency?

@frett
Copy link
Author

frett commented Jul 22, 2021

I'm using the new VERSION_CATALOGS gradle feature.

libs.version.toml:

[versions]
splitties = "3.0.0-beta03"

[libraries]
splitties-bitflags = { module = "com.louiscad.splitties:splitties-bitflags", version.ref = "splitties" }

build.gradle.kts:

kotlin {
    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(libs.splitties.bitflags)
            }
        }
    }
}

PR with the upgrade: CruGlobal/kotlin-mpp-godtools-tool-parser#88

@frett
Copy link
Author

frett commented Jul 22, 2021

hmm, it appears to be running fine in Github Actions, but not on my local machine. I'll do a bit of debugging on my end.

I take that back, it's only failing for the ios target, it works for the other targets

@LouisCAD
Copy link
Owner

Do you still have the issue when adding the following into your gradle.properties file?

Documentation: https://kotlinlang.org/docs/reference/mpp-share-on-platforms.html
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false

@frett
Copy link
Author

frett commented Jul 23, 2021

yeah, still have the same issue when setting those flags.

@frett
Copy link
Author

frett commented Jul 23, 2021

I created a minimal reproduction project here: https://github.com/frett/splitties-mpp-dependency-issue

when the dependency is set to 3.0.0-beta01 the build succeeds, when it's set to 3.0.0-beta03 the build fails

@LouisCAD
Copy link
Owner

Thanks for the report and the reproducer, and sorry for the vacations related delay.

I'm on it, with a solution that should prevent this from happening again, no matter what subtle changes take place in the Kotlin Gradle plugin.

LouisCAD added a commit that referenced this issue Jul 30, 2021
This should make issues like #280 impossible.
@LouisCAD
Copy link
Owner

Fixed in 3.0.0-beta04 that I just released.
Should be available on MavenCentral within half an hour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants