Moving Android Studio to another drive is a task that many developers face, especially when the system partition C: runs out of free space. Unlike conventional apps, it Android Studio stores not only executable files, but also caches, emulators, SDKs and projects, which can occupy tens of gigabytes. Simply copying a folder or reinstalling with changing the path often leads to assembly errors, missing settings or broken emulators.

In this article we will look at three working transfer methods: through the settings itself Android Studio, manual movement with editing configuration files and a complete reinstallation with path redirection. Each method has its advantages and pitfalls - for example, When manually migrating the SDK, you must manually update the environment variables ANDROID_HOME and PATH, otherwise Gradle will not be able to find the build tools. You will also learn how to avoid common errors like "Failed to load the JNI shared library" or problems with licenses after migration.

1. Preparing for the transfer: what you need to do before you start

Before you begin the transfer, make sure that you have:

  • ๐Ÿ”ง Backup copy of projects (export via File โ†’ Export Settings or copy the folder ~\AndroidStudioProjects).
  • ๐Ÿ“ Free space on the target disk (at least 1.5 times more than the current installation occupies Android Studio).
  • ๐Ÿ› ๏ธ Administrator rights (needed for editing system variables and registry).
  • ๐Ÿ“ List of installed plugins (can be viewed in File โ†’ Settings โ†’ Plugins).

Pay special attention SDK and emulators. By default they are stored in:

  • C:\Users\\AppData\Local\Android\Sdk โ€”the main SDK tools.
  • C:\Users\\.android\avd โ€”emulator images.
  • C:\Users\\AndroidStudio\config โ€”IDE settings.
โš ๏ธ Attention: If you use Android Studio Giraffe (2022.3.1) or newer, the path to the SDK may be different. Check the current location in File โ†’ Settings โ†’ Appearance & Behavior โ†’ System Settings โ†’ Android SDK.

It is also recommended to close all instances Android Studio and disable the antivirus (it may block changes to system folders). If you are working with Git, do so. commit or stash current changes in projects - this will protect you from losing unsaved data.

๐Ÿ“Š How much space does your current Android Studio installation take up?
Less than 10 GB
10โ€“30 GB
30โ€“50 GB
More than 50 GB

2. Method 1: Transfer through Android Studio settings (the safest)

This method is suitable for transfer SDK, emulators and cache, but does not affect the app itself. Its advantage is the minimal risk of failures, since all paths are updated automatically.

Steps:

  1. Open Android Studio and go to File โ†’ Settings โ†’ Appearance & Behavior โ†’ System Settings โ†’ Android SDK.
  2. Click on the gear icon next to the field Android SDK Location and select Edit.
  3. Specify a new folder on the target disk (for example, D:\Android\Sdk) and confirm.
  4. Wait, while Android Studio copies the files (this may take 10-30 minutes depending on the volume).
  5. Similarly, transfer the folder with emulators (.android\avd) via File โ†’ Settings โ†’ Tools โ†’ Emulator.

After the transfer, check the work:

  • ๐Ÿ”„ Restart Android Studio and wait for the projects to be indexed.
  • ๐Ÿ“ฑ Launch any emulator (if they are not displayed, update the list in AVD Manager).
  • ๐Ÿ› ๏ธ Build the project (Build โ†’ Make Project) - if there are no errors, the transfer was successful.
โš ๏ธ Attention: If after migrating the SDK you see the error "Failed to find target with hash string", delete the folder ~\.android\cache and restart Android StudioThis will reset the Gradle cache.

โ˜‘๏ธ Checklist for method 1

Completed: 0 / 5

3. Method 2: Manual movement with configuration editing (for experienced)

This method allows you to transfer the entire installation of Android Studio, including the app itself, SDK and settings. It is more complicated, but gives full control over. process.

Instructions:

  1. Copy the folders:
    • The installed folder Android Studio (usually C:\app Files\Android\Android Studio).
    • Folder ~\.AndroidStudio (IDE settings).
    • Folders ~\.android, ~\Android\Sdk and ~\AppData\Local\Google\AndroidStudio (cache and SDK).
  • Update environment variables:
    SETX /M ANDROID_HOME "D:\Android\Sdk"
    

    SETX /M PATH "%PATH%;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools"

    (Run command line as administrator.)

  • Editing the registry (if necessary):

    Open regedit and find the keys along the path HKEY_LOCAL_MACHINE\SOFTWARE\Android Studio. Update the paths to the SDK and executable files.

  • Create a shortcut:

    Specify the new path to studio64.exe in the shortcut properties (for example, D:\Android\Android Studio\bin\studio64.exe).

  • After the transfer you may need:

    • ๐Ÿ”„ Reinstall plugins (some store paths in absolute form).
    • ๐Ÿ“ Update the path to the JDK in File โ†’ Project Structure โ†’ SDK Location.
    • ๐Ÿ› ๏ธ Rebuild all projects (Build โ†’ Rebuild Project).
    Problem after migration Cause Solution
    Error "JNI shared library not found" Incorrect path to JDK or SDK Check Project Structure โ†’ SDK Location and variable JAVA_HOME
    Emulators do not start The path to avd is not updated Move the folder .android\avd and update the path to AVD Manager
    Gradle does not find dependencies Gradle cache references old paths Delete ~\.gradle\caches and restart the build
    What to do if Android Studio does not start after the transfer?

    If the IDE does not start, check:

    1. Rights to the folder with the new installation (must be full for your user).

    2. Antivirus - it could delete files during copying.

    3. Logs in ~\.AndroidStudio\log\idea.log - there may be detailed information. error.

    4. Reinstall Android Studio over the copied files (select the same version).

    4. Method 3: Complete reinstallation with path redirection

    This method is suitable if you want a โ€œcleanโ€ installation on a new disk, but with saving projects and settings. It is the most reliable, but takes more time.

    Step-by-step guide:

    1. Export settings:

      In the old one Android Studio select File โ†’ Manage IDE Settings โ†’ Export Settings and save the file settings.jar.

    2. Uninstall the old version:

      Uninstall Android Studio via Control Panel โ†’ apps and Features.

    3. Install again:

      Download installer from official website and during installation, specify the target drive (for example, D:\Android\Android Studio).

    4. Import settings:

      After installation, import settings.jar via File โ†’ Manage IDE Settings โ†’ Import Settings.

    5. Configure the SDK:

      In a new installation, specify the path to the SDK on the target disk (File โ†’ Settings โ†’ Android SDK) and wait for the missing components to load.

    Advantages of this method:

    • ๐Ÿงน Clean system without "garbage" from the old installation.
    • ๐Ÿ”„ Automatic update of all paths in configuration files.
    • ๐Ÿ›ก๏ธ Minimal risk of conflicts with previous versions.
    โš ๏ธ Attention: If you use Flutter or other frameworks, after reinstallation may require re-configuring the plugins. For example, for Flutter you need to re-specify the path to the SDK in File โ†’ Settings โ†’ Languages & Frameworks โ†’ Flutter.
    ๐Ÿ’ก

    If after reinstallation the projects open with errors, try deleting the folders .idea and build in the root of the project, and then rebuild it (File โ†’ Invalidate Caches / Restart).

    5. Transferring projects and Gradle dependencies

    Even if you successfully transferred Android Studio, projects may not be built due to old paths in the files build.gradle or local.properties. Here's what you need to check:

    1. File local.properties:

    sdk.dir=D\:\\Android\\Sdk
    

    ndk.dir=D\:\\Android\\Sdk\\ndk\\

    Update the paths to the SDK and NDK (if used).

    2. File gradle.properties (in the project folder or ~\.gradle):

    android.useAndroidX=true
    

    org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8

    Make sure there are no absolute paths to the old installation here.

    3. Gradle cache:

    • Delete the folder ~\.gradle\caches.
    • In the project run File โ†’ Sync Project with Gradle Files.
    • If the build fails with the error "Could not find", try Gradle โ†’ Refresh Gradle Project.

    To speed up the first build after migration, you can:

    • ๐Ÿ“ฅ Download dependencies in advance: Gradle โ†’ Download Sources.
    • ๐Ÿ”„ Use Gradle offline mode (add org.gradle.offline=true to gradle.properties).
    • ๐Ÿ—‘๏ธ Clear old cache: File โ†’ Invalidate Caches / Restart โ†’ Invalidate and Restart.
    ๐Ÿ’ก

    After transfer, always check the files local.properties i gradle.properties โ€”they often contain absolute paths that lead to errors assembly.

    6. Optimizing space after transfer

    Transferring to another drive is a good reason to clean up unnecessary files. Here's what you can safely delete:

    • ๐Ÿ—‘๏ธ Old SDK versions: V Android SDK Manager remove unnecessary platforms (for example, Android 5.0if you do not support legacy devices).
    • ๐Ÿงน Gradle cache: folder ~\.gradle\caches can weigh several gigabytes. Delete it and rebuild the projects.
    • ๐Ÿ“ฑ Unnecessary emulator images: in AVD Manager remove unused devices (for example, emulators for Android TVif you are developing only for smartphones).
    • ๐Ÿ”„ IDE logs: folder ~\.AndroidStudio\log can take up to 1โ€“2 GB. Archive or delete old logs.

    Also recommended:

    • ๐Ÿ“ฆ Move projects to SSD: if the target disk is HDD, and you have an SSD, store active projects on it for speed up the build.
    • ๐Ÿ”ง Configure automatic cleaning: to File โ†’ Settings โ†’ Build, Execution, Deployment โ†’ Gradle enable the option Offline work and limit the cache size.
    • ๐Ÿ“Š Use Disk Usage Analyzer: apps like WinDirStat will help you find โ€œheavyโ€ files that can be deleted.

    If you work with emulators, pay attention to their settings:

    • ๐Ÿ–ฅ๏ธ Use x86images instead of ARM - they are faster and take up less space.
    • ๐Ÿ“ Reduce the size of the emulator virtual disk (in the device settings c AVD Manager).
    • ๐Ÿ”„ Enable Quick Boot (saving the emulator state) - this will speed up the launch, but will require additional space.

    7. Typical errors and their solutions

    Even with a careful transfer, problems can arise. their fixes:

    Error Probable cause Solution
    "Failed to load the JNI shared library" Incorrect path to JDK or SDK Check variables JAVA_HOME and ANDROID_HOME. Reinstall the JDK if necessary.
    "Emulator: PANIC: Missing emulator engine app" The path to the emulator is not updated Move the folder .android\avd and update the path in AVD Manager.
    "Gradle sync failed: Could not find com.android.tools.build:gradle:X.X.X" Gradle cache references old paths Delete ~\.gradle\caches and restart synchronization.
    "Android Studio does not see the device" ADB drivers are not installed Update drivers via SDK Manager โ†’ SDK Tools โ†’ Google USB Driver.
    "License not accepted" for SDK components Licenses have not been transferred Run SDK Manager and accept the licenses again.

    If none of the methods helped, try:

    1. Remove all traces Android Studio using Revo Uninstaller (it even deletes registry entries).
    2. Install Android Studio again, but this time select Custom Installation and manually specify the paths to all components.
    3. Check the integrity of the downloaded files (sometimes the installer may be damaged).
    ๐Ÿ’ก

    If after Transfer Android Studio slows down, try disabling plugins that you do not use (File โ†’ Settings โ†’ Plugins). Especially โ€œheavyโ€ ones - Firebase, Google Cloud Tools i Flutter.

    FAQ: Frequently asked questions about transferring Android Studio

    Is it possible to transfer Android Studio without reinstalling?

    Yes, but this requires manual editing of configuration files and environment variables. Method 2 in this article describes step-by-step guide. However, if you are not confident in your skills, it is better to use Method 1 (transfer through IDE settings) or Method 3 (clean reinstallation).

    Why after the transfer emulators do not start?

    Most likely, the path to the folder .android\avdwhere the emulator images are stored has not been updated. Move this folder to a new drive and specify the new path in File โ†’ Settings โ†’ Tools โ†’ Emulator. Also check that your devices are displayed - if they are not, import them again. AVD Manager Your devices are displayed - if they are not, import again.

    How to transfer projects so that they open without errors?

    It is better to transfer projects together with folders .idea and build, but before the first launch on a new installation:

    1. Delete the folder build in the project root.
    2. Open the project in a new one Android Studio.
    3. Execute File โ†’ Sync Project with Gradle Files.
    4. If there is errors, update the paths in local.properties i gradle.properties.
    How much space does Android Studio take up after the transfer?

    The volume depends on the number of installed SDKs, emulators and projects. Approximate calculation:

    • Android Studio (app itself): 1โ€“2 GB.
    • SDK (minimum installation): 3โ€“5 GB.
    • Emulators (1 image = 1โ€“2 GB, plus cache).
    • Gradle cache: 1โ€“5 GB (depending on the number of projects).
    • Projects: from 100 MB to several GB each.

    Total: recommended for comfortable work allocate at least 20-30 GB on the target disk.

    Is it possible to transfer Android Studio to an external drive (USB or HDD)?

    Technically yes, but it not recommended for the following reasons:

    • ๐Ÿข Low speed: external HDDs and even USB 3.0 are much slower than SSDs, which will affect the assembly of projects and the operation of emulators.
    • ๐Ÿ”Œ Risk of data loss: if the disk turns off during work, projects may be damaged.
    • ๐Ÿ”ง Problems with paths: some tools (for example, NDK) do not work well with network or removable drives.

    If there is no other option no, use SSD drive with USB-C 3.1 and make sure that:

    • The disk is formatted in NTFS (not FAT32).
    • Write caching is enabled (in properties disk in Disk Management).
    • You are using shortcuts (for example, D:\AS\Sdk instead of D:\My Documents\Android\SDK\...).