# How to set useFallbackCompilerSearch?

**URL:** <https://discuss.kotlinlang.org/t/how-to-set-usefallbackcompilersearch/9039>\
**Category:** Support\
**Created:** [August 13, 2018, 6:31pm UTC](https://discuss.kotlinlang.org/t/how-to-set-usefallbackcompilersearch/9039 "2018-08-13T18:31:01Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![tsvetkov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/tsvetkov/32/6181_2.png) [@tsvetkov](https://discuss.kotlinlang.org/u/tsvetkov)\
**Post date:** [August 15, 2018, 12:08pm UTC](https://discuss.kotlinlang.org/t/how-to-set-usefallbackcompilersearch/9039/3 "2018-08-15T12:08:44Z")

</div>

@nanodeath Yes, you’ve described the correct way to use the flag. However the flag is intended only as a workaround just in case there is some case that cannot be fixed by other means.  
We’ve changed the way Kotlin plugin searches the compiler:

- Previously it tried to find the compiler in Kotlin Gradle plugin dependencies. There is no way to do this reliably in Gradle, so the solution was fragile and slow.
- Since 1.2.60 Kotlin Gradle plugin resolves ‘kotlinCompilerClasspath’ configuration in each subproject it is applied to. By default `kotlinCompilerClasspath` resolves ‘org.jetbrains.kotlin:kotlin-compiler-embeddable:\<PLUGIN\_VERSION\>’ artifact in each subproject with kotlin plugin. If project uses `mavenCentral` or `jcenter` repositories, then everything should work. If something breaks, then a subproject does not use these repositories, but that also means that it cannot resolve ‘org.jetbrains.kotlin:kotlin-stdlib’ from these repositories either. So if you use `mavenCentral` or `jcenter`, then you should just add them to problematic subprojects.

The dependency should resolve through `mavenCentral`, but only trough project repository, not buildscript one.

Won’t work:

```auto
buildscript {
     repositories {
         mavenCentral()
     }
     dependencies {
          classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.60'
     }
}

apply plugin: 'kotlin'

```

Should work:

```auto
buildscript {
     repositories {
         mavenCentral()
     }
     dependencies {
          classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.60'
     }
}

apply plugin: 'kotlin'

repositories {
    // this repo should be available in every subproject that uses kotlin
    mavenCentral() // or jcentrer
}

```

---

_[View the full topic](https://discuss.kotlinlang.org/t/how-to-set-usefallbackcompilersearch/9039)._
