Error: unresolved reference: R

I use Kotlin compiler on Android devices. when i compile simple code it works fine, but when i compile android project i get such an error.

I tried adding -Xplugin = Path android-extensions-compiler.jar but it had no effect at all.

then how does kotlin read resources?
do you use aapt first to produce R.java?