问题描述
我的android项目是用Kotlin 100%编写的,我想将java目录重命名为kotlin以保持一致.我添加了
My android project is written 100% in Kotlin and I wanted to rename the java directory to kotlin to be consistent. I added
sourceSets{
main.java.srcDirs += 'src/main/kotlin'
}
gradle并重命名目录.所有的程序都可以编译并正常工作.
to gradle and renamed the directory. All compiles and works fine.
唯一的问题是,当我在项目选项卡中的"Android"视图中时,目录仍名为"java"(如果在下拉菜单中切换至项目视图,则确实会看到"kotlin").
The only issue is that when I am in the project tab, in "Android" view the directory is still named "java" (if I switch to the project view in the dropdown, I do see "kotlin" tho).
我想念什么?
推荐答案
我也一样.它仅在"Android"视图中发生.当我在Finder中导航到该文件夹时,其名为"kotlin".看起来这是Android Studio中的错误.
I have the same. It happens only in "Android" view. When I navigate to that folder in Finder it's named 'kotlin'.Looks like it's a bug in the Android studio.
这篇关于重命名"java"目录到"kotlin";在Android Studio中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!