adnan ijaz
adnan ijaz

Reputation: 109

Flutter not creating Java Classes only Kotlin Instead

I am creating a simple flutter project with latest stable version of flutter. The project, I am creating is without any kotlin support because I want to use java but it is still creating only Kotlin MainActivity class by default. is there a way to use java?

Upvotes: 9

Views: 9072

Answers (2)

digitaljoni
digitaljoni

Reputation: 1397

If you are creating a new flutter app using the latest stable version, the default now is Kotlin for android and Swift for IOS. You can read more here: https://github.com/flutter/flutter/issues/21190

If you want to create a new app using Java for Android and Objective-C for IOS use the following command:

flutter create -i objc -a java new_app

And if you have an existing app

flutter create -i objc -a java .

Upvotes: 31

Wimukthi Rajapaksha
Wimukthi Rajapaksha

Reputation: 1019

You can convert your current flutter project to desired source languages using flutter create -i swift/objc -a kotlin/java ., reference

Upvotes: 3

Related Questions