如何从Android项目中删除Kotlin支持? [英] How to remove Kotlin support from an Android project?

查看:1354
本文介绍了如何从Android项目中删除Kotlin支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从新项目中删除kotlin支持并仅使用Java支持而不创建新项目?

How to remove kotlin support from a new project and work with only java support without creating a new project ?

推荐答案

步骤1:build.gradle (Project)文件中删除或注释掉这些行.

Step 1: Delete or comment-out these lines from build.gradle (Project) file.

ext.kotlin_version = '1.1.51' // My kotlin_version might be different from yours.
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

步骤2:build.grale (Module)文件中删除或注释掉这些行

Step 2: Delete or comment-out these lines from build.grale (Module) file

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

第3步:,然后点击Sync Now.

注意:每当您导航到kotlin类时,就会在其标题上始终看到一个弹出窗口,并且代码仍会突出显示.

Note: Whenever you navigate to kotlin classes, you will see a popup always display on their header and the code is still highlighted.

要删除此弹出窗口且不突出显示Kotlin代码,请转到File -> Settings禁用Kotlin插件.

To remove this popup and do not highlight kotlin code, go to File -> Settings to disable Kotlin plugin.

然后点击Apply -> OK,之后将显示一个对话框,通知您重置Android Studio,只需点击reset.下次打开项目时,弹出窗口消失,并且kotlin代码不再突出显示.就像项目中的普通文件一样.

Then hit on Apply -> OK, after that a dialog will display to notify you reset Android Studio, just hit reset. Next time you open the project, the popup is gone and kotlin code is not highlighted anymore. It just like a normal file in your project.

这篇关于如何从Android项目中删除Kotlin支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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