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 Settingsor 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.
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:
- Open Android Studio and go to
File โ Settings โ Appearance & Behavior โ System Settings โ Android SDK. - Click on the gear icon next to the field
Android SDK Locationand selectEdit. - Specify a new folder on the target disk (for example,
D:\Android\Sdk) and confirm. - Wait, while Android Studio copies the files (this may take 10-30 minutes depending on the volume).
- Similarly, transfer the folder with emulators (
.android\avd) viaFile โ 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
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:
- Copy the folders:
- The installed folder Android Studio (usually
C:\app Files\Android\Android Studio). - Folder
~\.AndroidStudio(IDE settings). - Folders
~\.android,~\Android\Sdkand~\AppData\Local\Google\AndroidStudio(cache and SDK).
- The installed folder Android Studio (usually
SETX /M ANDROID_HOME "D:\Android\Sdk"
SETX /M PATH "%PATH%;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools"
(Run command line as administrator.)
Open regedit and find the keys along the path HKEY_LOCAL_MACHINE\SOFTWARE\Android Studio. Update the paths to the SDK and executable files.
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:
- Export settings:
In the old one Android Studio select
File โ Manage IDE Settings โ Export Settingsand save the filesettings.jar. - Uninstall the old version:
Uninstall Android Studio via
Control Panel โ apps and Features. - Install again:
Download installer from official website and during installation, specify the target drive (for example,
D:\Android\Android Studio). - Import settings:
After installation, import
settings.jarviaFile โ Manage IDE Settings โ Import Settings. - 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=truetogradle.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 Managerremove unnecessary platforms (for example,Android 5.0if you do not support legacy devices). - ๐งน Gradle cache: folder
~\.gradle\cachescan weigh several gigabytes. Delete it and rebuild the projects. - ๐ฑ Unnecessary emulator images: in
AVD Managerremove unused devices (for example, emulators forAndroid TVif you are developing only for smartphones). - ๐ IDE logs: folder
~\.AndroidStudio\logcan 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 โ Gradleenable the optionOffline workand 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 ofARM- 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:
- Remove all traces Android Studio using Revo Uninstaller (it even deletes registry entries).
- Install Android Studio again, but this time select Custom Installation and manually specify the paths to all components.
- 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:
- Delete the folder
buildin the project root. - Open the project in a new one Android Studio.
- Execute
File โ Sync Project with Gradle Files. - If there is errors, update the paths in
local.propertiesigradle.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(notFAT32). - Write caching is enabled (in properties disk in
Disk Management). - You are using shortcuts (for example,
D:\AS\Sdkinstead ofD:\My Documents\Android\SDK\...).