How to Import Source Code in Android Studio — Step by Step Guide 2026. So you just downloaded a source code project — maybe from GitHub, or purchased it from a developer — and now you are staring at a folder on your computer wondering how to open it in Android Studio. You are in the right place.

In this guide, we walk you through exactly how to import source code in Android Studio — step by step — whether it is a Flutter project, a native Android project, or any existing project from the internet.

What You Need Before Starting

Before importing any source code, make sure you have the following installed on your computer:

  • Android Studio — download the latest version from developer.android.com/studio
  • Flutter SDK — if the project is a Flutter app (flutter.dev/docs/get-started/install)
  • Java JDK — Android Studio usually bundles this automatically
  • Git — optional, but recommended if you cloned the project from GitHub

Method 1 — Import a Flutter Project in Android Studio

If you purchased or downloaded a Flutter source code project, follow these steps.

Step 1: Download and Extract the Source Code

If the project came as a .zip file, right-click the file and select Extract All (Windows) or double-click to extract (Mac). Place the extracted folder somewhere easy to find — like your Desktop or Documents folder.

Step 2: Open Android Studio

Launch Android Studio on your computer. You will see the Welcome to Android Studio screen if no project is currently open.

Step 3: Click "Open"

On the Welcome screen, click the Open button (not "New Project"). This allows you to browse your computer and select an existing project folder.

If Android Studio is already open with another project, go to:

File → Open

Step 4: Navigate to the Project Folder

A file browser window will open. Navigate to the folder where you extracted the source code. Select the root folder of the project — the one that contains the pubspec.yaml file for Flutter projects.

Important: Select the folder itself, not a file inside it. Then click OK or Open.

Step 5: Wait for the Project to Load

Android Studio will open the project and begin indexing. You will see a progress bar at the bottom of the screen. This may take 1 to 3 minutes depending on your computer speed.

Step 6: Run Flutter pub get

Once the project loads, open the Terminal inside Android Studio by clicking:

View → Tool Windows → Terminal

Or press Alt + F12 (Windows/Linux) or Option + F12 (Mac).

In the terminal, type:


bash

flutter pub get

This downloads all the packages and dependencies the project needs. Wait for it to complete.

Step 7: Select a Device or Emulator

At the top of Android Studio, you will see a device selector dropdown. Select either:

  • A connected physical device (Android phone plugged in via USB)
  • An Android Emulator (create one via AVD Manager if you don't have one)

Step 8: Run the Project

Click the green Run button (triangle icon) at the top of Android Studio, or press:

Shift + F10 (Windows/Linux)
Control + R (Mac)

The app will build and launch on your selected device or emulator.

Method 2 — Import a Native Android Project

If the source code is a native Android project (Kotlin or Java), follow these steps.

Step 1: Extract the Project Folder

Same as before — extract the .zip file to a location on your computer.

Step 2: Open Android Studio and Click Open

On the Welcome screen, click Open, then navigate to the project folder. For native Android projects, select the folder that contains the build.gradle file.

Step 3: Wait for Gradle Sync

Android Studio will automatically start a Gradle sync — this downloads all the dependencies defined in the build.gradle file. You will see a progress notification at the bottom.

If Gradle sync fails, check the error message in the Build panel at the bottom. Common fixes are covered below in the Troubleshooting section.

Step 4: Set the SDK Version

If you see an error about SDK version, go to:

File → Project Structure → SDK Location

Make sure the Android SDK location is correctly set to where your SDK is installed. On most computers this is:

Windows: C:\Users\YourName\AppData\Local\Android\Sdk
Mac: /Users/YourName/Library/Android/sdk

Step 5: Run the Project

Select a device or emulator and click the Run button. The project will build and launch.

Method 3 — Import a Project from GitHub

If the source code is hosted on GitHub, you can import it directly into Android Studio without manually downloading a ZIP file.

Step 1: Copy the GitHub Repository URL

Go to the GitHub repository page. Click the green Code button and copy the HTTPS URL. It will look like:

https://github.com/username/repository-name.git

Step 2: Open Android Studio and Click "Get from VCS"

On the Welcome screen, click Get from VCS (Version Control System). If Android Studio is already open, go to:

File → New → Project from Version Control

Step 3: Paste the URL and Clone

In the dialog box that appears:

  • Paste the GitHub repository URL in the URL field
  • Choose a Directory on your computer where the project will be saved
  • Click Clone

Android Studio will download the entire repository to your computer.

Step 4: Open the Cloned Project

Once cloning is complete, Android Studio will ask if you want to open the project. Click Yes. The project will load and begin indexing automatically.

Step 5: Run Flutter pub get or Gradle Sync

Depending on whether it is a Flutter or native Android project:

For Flutter:

bash

flutter pub get

For native Android — Gradle sync will start automatically.

Common Errors and How to Fix Them

Error 1: Flutter SDK Not Found

Error message:

Flutter SDK not found. Please configure Flutter SDK location.

Fix:

Go to:

File → Settings → Languages & Frameworks → Flutter

Set the Flutter SDK path to where you installed Flutter. On most computers:

Windows: C:\flutter
Mac: /Users/YourName/flutter

Error 2: Gradle Sync Failed

Error message:

Gradle sync failed: Could not resolve dependencies

Fix:

Check your internet connection and try again. If the issue persists:

File → Invalidate Caches → Invalidate and Restart

Then sync again after Android Studio restarts.

Error 3: Package Not Found After flutter pub get

Error message:

Because [package] depends on [dependency] which doesn't exist, version solving failed.

Fix:

The project may require a specific Flutter version. Check the pubspec.yaml file for the minimum Flutter version requirement and make sure your Flutter is updated:

bash

flutter upgrade
flutter pub get

Error 4: Minimum SDK Version Error

Error message:

Minimum supported Gradle version is X.X

Fix:

Open android/build.gradle and update the Gradle version to the one specified in the error message:

gradle

classpath 'com.android.tools.build:gradle:8.1.0'

Error 5: Java Version Mismatch

Fix:

Go to:

File → Project Structure → SDK Location → JDK Location

Make sure you are using JDK 17 or above, which is required for modern Android and Flutter projects.

Pro Tips for Importing Source Code

  • Always read the README.md file in the project folder before importing — it usually contains setup instructions specific to that project
  • Make sure your Flutter SDK and Android Studio are both updated to the latest version before importing any new project
  • If the project has a .env file requirement, create it before running the app or you will get missing key errors
  • For purchased source codes, always check if there is a setup guide or documentation folder included with the project
  • Use flutter doctor in the terminal to check if your Flutter setup is healthy before importing a new project

bash

flutter doctor

A healthy setup should show all green checkmarks.


Conclusion

Importing source code in Android Studio is straightforward once you know the steps. Whether you are opening a Flutter project, a native Android app, or cloning directly from GitHub — the process is consistent and beginner-friendly.

With this guide, you can confidently open any downloaded or purchased source code and get it running on your device in minutes.

Happy coding!