Kotlin无法在Android Studio上运行 [英] Kotlin not working on Android Studio

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

问题描述

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

  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.

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

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. 插件"Kotlin Extensions For Android(已淘汰)无法正确安装.我可以单击安装",但它不起作用.

我的Android Studio版本2.1.2

My Android Studio Version 2.1.2

推荐答案

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

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

还请注意,"Android的Kotlin扩展(已淘汰)"名称中带有已淘汰"字样的原因是专门让您知道您不应安装该插件.

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天全站免登陆