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

Plugin error: "Cannot change dependencies of dependency configuration" #2393

Closed
hitherejoe opened this issue Jun 24, 2020 · 2 comments · Fixed by #2400
Closed

Plugin error: "Cannot change dependencies of dependency configuration" #2393

hitherejoe opened this issue Jun 24, 2020 · 2 comments · Fixed by #2400

Comments

@hitherejoe
Copy link

Summary

After applying the "com.apollographql.apollo" plugin in a multiplatform library module I'm hitting this error when trying to build:

`A problem occurred configuring project ':shared:SharedAuthentication'.

Failed to notify project evaluation listener.
Cannot change dependencies of dependency configuration ':shared:SharedAuthentication:androidApi' after it has been included in dependency resolution.
Cannot change dependencies of dependency configuration ':shared:SharedAuthentication:androidTestApi' after it has been included in dependency resolution.
Cannot change dependencies of dependency configuration ':shared:SharedAuthentication:iosApi' after it has been included in dependency resolution.
Cannot change dependencies of dependency configuration ':shared:SharedAuthentication:iosTestApi' after it has been included in dependency resolution.
Cannot change dependencies of dependency configuration ':shared:SharedAuthentication:iosCompileKlibraries' after it has been resolved.
Cannot change dependencies of dependency configuration ':shared:SharedAuthentication:iosTestCompileKlibraries' after it has been resolved.
Cannot change attributes of dependency configuration ':shared:SharedAuthentication:iosApiElements' after it has been resolved`

Version

Apollo: 2.2.1
Kotlin: 1.3.72

Description

This happens whenever trying to build the project. The branch where this is occurring is available here.

I've double checked against the sample and can't quite spot anything that might be misconfigured in my project. Maybe there is a bug causing this problem with the plugin, so thought it was worth raising!

@martinbonnin
Copy link
Contributor

Thanks for sending this!

We have some code in the plugin that ensures the compiler version matches the runtime version else some weird crashes occur.

This code resolves the configurations at configuration time but it looks like the Kotlin plugin also want to change some constraints on dependencies and in your case, this would happen too late. I'm not 100% sure how these thing work but I'll look into it, maybe make checkVersion lazy itself.

In the meantime, applying the multiplatform plugin after the apollo one seems to do the trick.

@hitherejoe
Copy link
Author

Thanks @martinbonnin - looks like that does that trick for now :)

martinbonnin added a commit to martinbonnin/apollo-kotlin that referenced this issue Jun 26, 2020
martinbonnin added a commit to martinbonnin/apollo-kotlin that referenced this issue Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants