Summary
To fix the Android & SD card error INSTALL_FAILED_INSUFFICIENT_STORAGE without losing data, follow a detailed guide. First, download Android data backup and recovery software to backup Android files to PC, ensuring nothing is lost during the fix. Then, apply each of the suggested methods to resolve the insufficient storage issue while installing apps.
Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
You're getting an "Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE" error while installing an app on your device, despite having freed up space on your SD card. To resolve this, try checking the device's internal storage for available space, as the issue might be with the device's internal storage rather than the SD card. You can also try clearing the app's data and cache, or uninstalling other apps to free up space. If the issue persists, consider reaching out to the app's developer or checking for any system updates.
9 out of 10 Android users face insufficient space issues, despite having ample internal or external storage, due to the failure of the system to properly utilize available space.
An Android app installation or update saves the APK file as /data/app/-1.apk (1.apk) initially, and when updated, saves it as /data/app/-2.apk (2.apk), with the first version (1.apk) being deleted normally.
When an updated app is about to install, but the old APK file hasn't been deleted, many Android devices experience an issue. The system tries to place the new APK file in the same location as the old one, but since the old file is still there, it results in an installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE.
To troubleshoot the "insufficient storage" error, a simple reboot of the device can often resolve the issue, but the problem may persist. Frustrated Android users may find themselves unable to install desired apps due to this error, which can be a nightmare. However, after researching and studying the issue, three potential fixing methods have been identified to potentially resolve the INSTALL_FAILED_INSUFFICIENT_STORAGE error.
Before attempting to troubleshoot, never forget to backup your Android device to your PC in advance. This is an essential procedure that you should do regularly.
1) Download and install Qiling MobiSaver for Android on a Windows PC.
Connect the target Android device to your PC, and wait for the software to recognize the device. Once detected, click "Start" to proceed with the process.
The scanning process on the Android phone is used for searching both existing and lost data.
After finding and displaying all the Android data, select the files you'd like to save and click "Recover" to create a backup copy, which can be saved to your PC's storage or other storage media like a USB flash drive or memory card.
Qiling Android data recovery tool ensures data safety, allowing users to carefully check each workaround to recover their data.
Fix 1. Delete both apk files
1) Uninstall the app
2) find the path of both files and use your method to delete them all.
/data/app/-1.apk
/data/app/-2.apk
Or just run(this is somewhat higher leveled):
adb shell "pm uninstall"
adb shell "rm -rf /data/app/-*"
Fix 2. Add android:installLocation attribute
1) In the AndroidManifest.xml file, add the line "android:installLocation="preferExternal"" within the manifest tag to specify the installation location for the app.
2) Go to settings --Clear the cache data on your device by going to storage --> click on cached data and clear the cache data. This will free up space.
Reconnect your device, clean your project, and run it again on the device, which should now successfully run the project.
Fix 3. Increase Android emulator's memory capacity
Right-click the root of your Android Project, go to "Run As" and then go to "Run Configurations...".
Locate the "Android Application" node in the tree at the left, and then select your project and go to the "Target" tab on the right side of the window. 3) In the "Target" tab, click on the "Create a new virtual device" button.
To install the OS, first download the OS image and extract it, then create a bootable USB drive with the extracted OS image. Next, create a virtual machine and add the OS image to it.
4) Click Apply and then Run to use your emulator.