Kotlin 不适用于 Android Studio [英] Kotlin not working on Android Studio

查看:40
本文介绍了Kotlin 不适用于 Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 无法在我的 Android Studio 上显示所有 kotlin 文件.即使直接将java文件转为koltin,也可以进行编辑,但不会出现在项目文件树中.IDE 还建议它是一个反编译的 .class 文件.

  2. 我无法创建 Kotlin 文件.当我这样做时,它会显示一个对话框,上面写着

<块引用>

无法创建文件/无法解析模板Kotlin 文件"错误消息:无法创建类文件

  1. 插件Kotlin Extensions For Android(obsolete) 无法正确安装.我可以点击安装,但它不起作用.

我的 Android Studio 2.1.2 版

解决方案

请确保 .kt 扩展名与设置中的 Kotlin 文件相关联 |编辑|文件类型.

另请注意,Kotlin Extensions for Android (obsolete)"之所以在名称中带有obsolete"字样,是为了让您知道不应安装该插件.

  1. All kotlin files can't be displayed on my Android Studio. Even when you directly convert java files into koltin, you can edit it, but it doesn't appear on the project file tree. Also the IDE suggests that it's a decompiled .class file.

  2. I can't create Kotlin files. When I do, it shows a dialog that says

Cannot Create File / unable o parse template "Kotlin File" Error message: Cannot create class-file

  1. The plugin "Kotlin Extensions For Android(obsolete) can't be installed properly. I can click install, but it doesn't work.

My Android Studio Version 2.1.2

解决方案

Please make sure that the .kt extension is associated with the Kotlin files in Settings | Editor | File Types.

Also note that the reason why "Kotlin Extensions for Android (obsolete)" has the "obsolete" word in its name is specifically to let you know that you should not install that plugin.

这篇关于Kotlin 不适用于 Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆