I can't create a new project with java language anymore on Android Studio Flamingo? – Java

by
Ali Hasan
android android-studio cucumber-java gradle-kotlin-dsl

Quick Fix: In Android Studio Flamingo |2022.2.1, when you are creating a new project, select Empty Views Activity. You can now select either Java or Kotlin as the programming language.

The Problem:

Unable to create a new project in Android Studio Flamingo version with Java language. The new project screen lacks the option to select languages, leaving Java unsupported. How can this issue be resolved to allow project creation with Java in Flamingo?

The Solutions:

Solution 1: Select Empty Views Activity

In Android Studio Flamingo (2022.2.1), the Java language is still supported. To create a new Java project, follow these steps:

  1. Select the "Empty Views Activity" template when creating a new project.

  2. In the configuration window that appears, you can specify the project name, package name, and language.

  3. Select "Java" as the language.

  4. Click "Finish" to create the project.

You will now have a new Java project in Android Studio Flamingo.

Solution 2: Compose Template Selection

The inability to create a Java project in Flamingo may be due to selecting the Compose template on the new project screen. Compose projects exclusively use Kotlin, so selecting a Compose template restricts the language options to Kotlin.

To resolve this issue, you can avoid selecting a Compose template and instead choose one of the traditional views options, such as:

  • Empty Activity
  • Basic Views Activity

These templates allow you to create projects in Java or Kotlin as desired.

Solution 3: Use Predefined Activities to Select Language

In Android Studio Flamingo, the option to select a language has been removed from the new project screen. To select your desired language, follow these steps:

  1. Create a new project using a predefined activity template, such as Empty Views Activity, Basic Views Activity, or Bottom Navigation Views Activity.
  2. Once the project is created, click on the “src/main/java” folder in the Project Explorer.
  3. Right-click on the “java” folder and select “New” > “Java Class”.
  4. Give the new class a name and click “OK”.
  5. In the “Edit Java Class” window, you can select either “Java” or “Kotlin” as the language for your class.

Note:

  • Empty Activity and Empty Views Activity are different.
  • Activity templates that use Jetpack Compose (e.g., Empty/Basic Activity) do not provide language selection options.
  • Activity templates that use XML layouts (e.g., Empty/Basic Views Activity) offer language selection (Java or Kotlin) upon class creation.

Solution 4: Downgrade Android Studio

As the solution suggests, one way to resolve this issue is to downgrade your Android Studio to a previous version, such as Electric Eel. Here’s how you can do it:

1. Backup Your Projects:

Before downgrading, make sure to back up all your important projects.

2. Uninstall Android Studio:

  • Windows: Go to Control Panel > Uninstall a program.
  • Mac: Move Android Studio to Trash.

3. Download the Previous Version:

4. Install the Previous Version:

  • Follow the installation instructions for the downloaded version.

5. Reopen Your Projects:

  • Once the previous version is installed, open your project files and they should load correctly.

Note:

  • Downgrading Android Studio may not be an ideal solution for everyone, as it can potentially lead to compatibility issues or loss of features. However, if you’re having difficulties creating new Java projects in Flamingo, it could be a temporary solution until the issue is addressed.

Q&A

There is no selection to choose java language while creating a new project?

You need to select Empty Views Activity or any other traditional activity instead of compose ones.

Android Studio Flamingo doesn’t support java

Flamingo supports java

How can I select Java in Flamingo?

Use Empty Views Activity or other traditional options

Video Explanation:

The following video, titled "Nas - I Can (Official HD Video) - YouTube", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

This video provides further insights and detailed explanations related to the content discussed in the article.