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

InvalidUserDataException with native (androidNative?) targets #566

Closed
natario1 opened this issue Aug 15, 2021 · 1 comment
Closed

InvalidUserDataException with native (androidNative?) targets #566

natario1 opened this issue Aug 15, 2021 · 1 comment

Comments

@natario1
Copy link
Contributor

natario1 commented Aug 15, 2021

Hi, as discussed in Slack - getting the following exception when using a single androidNative target:

Failed building KotlinMPPGradleModel
org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':sample:kspKotlinAndroidNativeX64'.
Caused by: org.gradle.api.InvalidUserDataException: Cannot change dependencies of dependency configuration ':sample:kotlinCompilerPluginClasspathAndroidNativeX64Main' after it has been resolved.
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.preventIllegalMutation(DefaultConfiguration.java:1260)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.validateMutation(DefaultConfiguration.java:1229)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$validateMutationType$1(DefaultConfiguration.java:308)
	at org.gradle.internal.ImmutableActionSet$SingletonSet.execute(ImmutableActionSet.java:225)
	at org.gradle.api.internal.DefaultDomainObjectSet.assertMutableCollectionContents(DefaultDomainObjectSet.java:71)
	at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:252)
	at org.gradle.api.internal.DelegatingDomainObjectSet.add(DelegatingDomainObjectSet.java:110)
	at org.gradle.api.internal.artifacts.DefaultDependencySet.add(DefaultDependencySet.java:68)
	at org.gradle.api.internal.artifacts.DefaultDependencySet.add(DefaultDependencySet.java:36)
	at com.google.devtools.ksp.gradle.KspGradleSubplugin.applyToCompilation$lambda-16$lambda-15(KspSubplugin.kt:343)

I set up a project that shows this issue: https://github.com/natario1/KSPBugs , but it basically boils down to:

plugins {
    id("kotlin-multiplatform")
    id("com.google.devtools.ksp")

}

kotlin {
    androidNativeX64()
}

dependencies {
    ksp(project(":processor"))
}

Note that other targets like jvm / js work properly. Did not try with native targets other than androidNative*.

@ting-yuan
Copy link
Collaborator

Per discussion on Slack, this is reproducible in AS. I verified that #568 works. Thanks for reporting the issue and the test case!

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