Reputation: 415
my android studio started working with kotlin and not java after the last update. I have a university project that I need to deliver soon and we only learned coding with java, can anyone please help me find a way to return it to java thanks a lot
Upvotes: 36
Views: 36409
Reputation: 34245
Android Studio disable Kotlin
If you would like disable Kotlin in your project you should delete MainActivity.kt
and remove next lines
build.gradle(Project)
//classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:<kotlin_version>"
build.gradle(App)
//apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android-extensions'
dependencies {
...
//implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:<kotlin_version>"
}
Upvotes: 4
Reputation: 1361
In the new version of Android Studio, instead of choosing "Empty Activity" as usual, choose "Empty Views Activity". Android Studio removed Java support in "Empty Activity".
Other answers are irrelevant because they explain how to choose Java for the previous versions where it was obvious anyway.
side personal notes:
This behavior is not typical to Google and is very surprising and aggressive.
It becomes dangerous to upgrade versions these days.
People love Java and are use to it.
It is great that Kotlin support was added but yet Java is powerful amazing programming language that will stay forever.
I use Java also for server side and for desktop applications so it is convenient to use same programming language for multiple platforms.
Android Studio doesn't even explain the change clearly.
Upvotes: 93
Reputation: 29
I understand the problem, it's simple, we are just missing the option to change the language while creating a new app. Just change the language to Java from kotlin.
I am sharing the steps for the same (currently using android studio chipmunk)
Step 1: Select New project from the menu
Step 2: Select the main Activity Type
Step 3: Find the option to change the language
Upvotes: 0
Reputation: 584
If I understand your problem correctly, when you create new project you have to uncheck "Include Kotlin support" checkbox at the bottom of "Create new project" window. And remember that you can create java classes in Kotlin project.
Upvotes: 6