Skip to content

Set up an environment

Sk Niyaj Ali edited this page Dec 25, 2024 · 1 revision

Project Requirement

  • AGP: 8.7.2 or later
  • Gradle: 8.9 or later
  • Java JDK - 17 or later

Install the necessary tools

We recommend installing the latest stable versions for compatibility and better performance. or install the Jetbrains Toolbox app to download and install all IDE.

Tool Comments
Android Studio You will use Android Studio to open our multiplatform applications and run them on simulated or hardware devices.

Xcode

Xcode is required if you want to run iOS applications on a simulated or real device. If you use a different operating system, skip this tool.

Launch Xcode in a separate window to accept its license terms and allow it to perform some necessary initial tasks.

Most of the time, Xcode will work in the background. You will use it to add Swift or Objective-C code to your iOS application.

We generally recommend using the latest stable versions for all tools. However, Kotlin/Native sometimes doesn't support the newest Xcode right away. You can check supported versions in the compatibility guide, and if necessary, install an earlier version of Xcode.

JDK To check whether Java is installed, run the following command in the Android Studio terminal or your command line: java -version and make sure you've installed Java JDK 17 version
Kotlin Multiplatform plugin

In Android Studio, open Settings (Preferences) and find the Plugins page. Search the Marketplace tab for Kotlin Multiplatform, and then install it.

The KMP plugin doesn't support K2 mode) yet. To use the plugin, disable K2 mode: in your IDE, go to Settings | Languages & Frameworks | Kotlin and uncheck the Enable K2 mode option.

Kotlin plugin

The Kotlin plugin is bundled and automatically updated with each Android Studio release.

Git

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.


Install Git

Before using Git in Android Studio, make sure Git is installed on your machine.

Windows: Download Git from Git for Windows and install it. macOS: Git is usually pre-installed. If not, you can install it via Homebrew (brew install git). Linux: Install Git through your package manager. For example:

sudo apt install git  # Debian-based systems
sudo yum install git  # Red Hat-based systems

Configure Git

Once Git is installed, configure it with your user information. Open a terminal or command prompt and run these commands:

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

Enable Git in Android Studio

Open Android Studio and go to the Settings or Preferences (on macOS):

Windows/Linux: File > Settings macOS: Android Studio > Preferences In the search bar, type Git to find the Git settings.

Under Version Control -> Git, make sure Git is selected. You may need to specify the path to the Git executable if it's not automatically detected (for most installations, Android Studio will find Git).

Click OK to save the settings.


Check your environment

To make sure everything works as expected, install and run the KDoctor tool:

Note

KDoctor works on macOS only. If you use a different operating system, skip this step.

  1. In the Android Studio terminal or your command-line tool, run the following command to install the tool using Homebrew:

    brew install kdoctor

    If you don't have Homebrew yet, install it or see the KDoctor README for other ways to install it.

  2. After the installation is completed, call KDoctor in the console:

    kdoctor
  3. If KDoctor diagnoses any problems while checking your environment, review the output for issues and possible solutions:

    • Fix any failed checks ([x]). You can find problem descriptions and potential solutions after the * symbol.
    • Check the warnings ([!]) and successful messages ([v]). They may contain useful notes and tips, as well.