# Compilation failed: Cyclic dependency in library graph even tho there isn't

**URL:** <https://discuss.kotlinlang.org/t/compilation-failed-cyclic-dependency-in-library-graph-even-tho-there-isnt/15747>\
**Category:** Support\
**Created:** [January 6, 2020, 6:38pm UTC](https://discuss.kotlinlang.org/t/compilation-failed-cyclic-dependency-in-library-graph-even-tho-there-isnt/15747 "2020-01-06T18:38:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lamba92](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/lamba92/32/5089_2.png) [@lamba92](https://discuss.kotlinlang.org/u/lamba92)\
**Post date:** [January 6, 2020, 6:38pm UTC](https://discuss.kotlinlang.org/t/compilation-failed-cyclic-dependency-in-library-graph-even-tho-there-isnt/15747/1 "2020-01-06T18:38:50Z")

</div>

I am building a multiplatform wrapper for Firebase (which is not really ready yet), I got this error that says that all fies in project `:auth` have a cyclic dependency over `:core`.  
Now the project has indeeed a `:core` project which is imported from every other project, but `:core` itself does not depends on any other project in the build.

Here’s some data:

- [project GitHub page](https://github.com/lamba92/firebase-multiplatform).
- [project plugin](https://github.com/lamba92/firebase-multiplatform/blob/master/buildSrc/src/main/kotlin/com/github/lamba92/firebasemultiplatform/build/FirebaseMultiplatformPlugin.kt).
- `:auth` [build.gradle.kts](https://github.com/lamba92/firebase-multiplatform/blob/master/auth/build.gradle.kts).
- [error output](https://travis-ci.com/lamba92/firebase-multiplatform/jobs/272802436#L333-L337) when building on TravisCI.
- [build scan](https://scans.gradle.com/s/2n7sd25xnqk3a)

I don’t really see any declared cyclic dependency in my buildscript. Is there any K/MPP expert that can help me pinpoint the cause?

EDIT: Oh well, it’s a Kotlin/Native compiler plugin [bug](https://youtrack.jetbrains.com/issue/KT-30348)!

---

<div class="post-metadata">

**Author:** ![darksnake](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/darksnake/32/2479_2.png) [@darksnake](https://discuss.kotlinlang.org/u/darksnake)\
**Post date:** [January 6, 2020, 6:58pm UTC](https://discuss.kotlinlang.org/t/compilation-failed-cyclic-dependency-in-library-graph-even-tho-there-isnt/15747/2 "2020-01-06T18:58:18Z")

</div>

Did you try to see output of gradle `::dependencies` task? It is not actually a kotlin error.

---

<div class="post-metadata">

**Author:** ![lamba92](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/lamba92/32/5089_2.png) [@lamba92](https://discuss.kotlinlang.org/u/lamba92)\
**Post date:** [January 6, 2020, 7:09pm UTC](https://discuss.kotlinlang.org/t/compilation-failed-cyclic-dependency-in-library-graph-even-tho-there-isnt/15747/3 "2020-01-06T19:09:28Z")

</div>

I always forget the Gradle goodness! I’ve added the build scan link in the main post, also here’s the [dependencies](https://scans.gradle.com/s/2n7sd25xnqk3a/dependencies?toggled=W1swXV0), I’ll look into them right now! Thanks for the advice.

EDIT 1: Maybe [here](https://scans.gradle.com/s/2n7sd25xnqk3a/dependencies?focusedDependencyView=details&toggled=W1swXSxbMCwxMF0sWzAsMTAsWzkzN11dXQ)?

EDIT 2: I found no cyclic dependency analyzing the dependency tree 🙄  
~~I suspect (with no actual proofs) that may be cause by my other [library](https://github.com/lamba92/firebase-ios-kotlin-native) which publishes Firebase iOS Framework cinterops for K/N (link to build scan [highlight](https://scans.gradle.com/s/2n7sd25xnqk3a/dependencies?focusedDependency=WzAsMTAsOTQxLFswLDEwLFs5MzcsOTQxXV1d&focusedDependencyView=details&toggled=W1swXSxbMCwxMF0sWzAsMTAsWzkzN11dXQ)), but it’s just a blind guess.~~ Nope…

EDIT 3: I noticed that IntelliJ says that `:auth` `iosArm64` source sets depends on themselves, but I’m not sure if that is an error since the same happens to `:core` but builds normally ([link to image](https://discuss.kotlinlang.org/uploads/short-url/gJ6lJ2zNE643AD36QdKv1o68dgX.jpeg)).

EDIT 4: Oh well, it’s a Kotlin/Native compiler plugin [bug](https://youtrack.jetbrains.com/issue/KT-30348)!

EDIT 5: I tried to publish `:core` and then import it from Maven for `:auth`, but same error! I believe at this point that the error is related to the Gradle metadata.
