Skip to content

Most visited

Recently visited

navigation

Known issues with Kotlin in Android Studio

This page describes known issues and limitations when using Kotlin with preview versions of Android Studio 3.2. For issues in the Android Studio stable release, see the Known issues page.

To report an issue not already included here, see how to report a bug.

Code doesn't compile after converting from Java file

In limited situations, using Code > Convert Java File to Kotlin File creates Kotlin code that does not compile. This is a known issue with the Kotlin plugin.

Code completion with Kotlin shows private resources

In Kotlin code completion, private resources are not filtered out the way they are from Java code completion. For example, typing R.drawable. lists internal appcompat resources as suggestions.

Live templates and postfix completion not fully available with Kotlin

When writing in Java language, you can use live templates or postfix completion, such as typing variable.for and pressing Tab to generate a for loop that iterates over the variable. However, these features are not fully available with Kotlin.

Some refactorings not available with Kotlin

Not all code refactorings work with Kotlin, especially those for Android. For example, code refactoring to modularize Kotlin code currently does not work.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)