Question: I am trying to use Jetbrains' Anko library to easily display an Android toast message in my app.

Here is the relevant code snippet:

```
val message : CharSequence = "Recycled: ${holder.taskEditText.text}"
(tasksFragment as Fragment).toast(text = message)

```

and the error:

```
Error:(80, 45) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline fun Fragment.toast(text: CharSequence): Unit defined in org.jetbrains.anko
public inline fun Fragment.toast(textResource: Int): Unit defined in org.jetbrains.anko
public fun Context.toast(text: CharSequence): Unit defined in org.jetbrains.anko
public fun Context.toast(textResource: Int): Unit defined in org.jetbrains.anko
public inline fun AnkoContext<*>.toast(text: CharSequence): Unit defined in org.jetbrains.anko
public inline fun AnkoContext<*>.toast(textResource: Int): Unit defined in org.jetbrains.anko

```

I am pretty new to Kotlin and have been searching for a solution to this issue for a while. All help is appreciated.

Answer: 
Since the error says none are applicable you've probably imported a different `Fragment` class than the one defined by Android/Support Library.

Check your imports.
I encountered the same issue using `import android.support.v4.app.Fragment`.

As Kingsley Adio said in a previous comment, add the following line in the dependencies specified in your module gradle file:

```
dependencies 
{
...
    implementation "org.jetbrains.anko:anko-support.v4-commons:$your_anko_version"
...
}

```

Then add this import in your .kt file:

```
import org.jetbrains.anko.support.v4.toast

```