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

IllegalArgumentException: List has more than one element when BOM is included #112

Open
lydavid opened this issue Aug 19, 2024 · 0 comments

Comments

@lydavid
Copy link

lydavid commented Aug 19, 2024

Error: Exception in thread "main" java.lang.IllegalArgumentException: List has more than one element.

	at kotlin.collections.CollectionsKt___CollectionsKt.single(_Collections.kt:610)
	at cash.grammar.kotlindsl.utils.DependencyExtractor.findIdentifier(DependencyExtractor.kt:221)
	at cash.grammar.kotlindsl.utils.DependencyExtractor.parseDependencyDeclaration(DependencyExtractor.kt:139)
	at cash.grammar.kotlindsl.utils.DependencyExtractor.collectDependencies(DependencyExtractor.kt:48)

When I remove the BOM, this goes away.

Example build.gradle.kts that failed until I commented out the BOM:

plugins {
    id("ly.david.musicsearch.kotlin.multiplatform")
    alias(libs.plugins.kotlin.serialization)
}

kotlin {
    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(projects.shared.domain)
                implementation(projects.core.logging.api)
                implementation(libs.koin.core)
//                implementation(project.dependencies.platform(libs.ktor.bom))
                implementation(libs.ktor.client.core)
                implementation(libs.ktor.serialization.kotlinx.json)
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(libs.kotlin.test)
            }
        }
    }
}

There's some GHA runs seen here: lydavid/MusicSearch#1069

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

1 participant