Adb install with error "INSTALL_FAILED_INSUFFICIENT_STORAGE"

I bought my first Android mobile Sony Xperia M, not suspecting that we cannot move applications to an external SD card. See the link for more details.

The only thing that Sony advises is to shorten the device, split and use third-party applications to move it. They also note that rooting may void the warranty.

My Android information about Sony Xperia M is listed below

Model number C1904 Android version 4.1.2 Build number 15.1.C.2.8 

I tried to execute the below commands from some forum and does not work for me,

 adb devices adb shell pm get-install-location adb shell pm set-install-location 2 

Although the above commands do not cause any errors, I can set the installation location as 2 (using adb shell pm get-install-location). Therefore, I believe that this is true. But then I tried to install some applications, and it is installed only in the internal memory.

I tried the apps2sd 'utility to move my applications and it shows the error below,

 'The device does not have a real primary external storage, or the primary external storage is emulated. Moving app to SD function cannot be supported by this device.' 

Finally, from another forum, I understand that we can install apk files using the adb install command to install directly to the SD card, as shown below,

 adb install -s C:\com.furkan0gul.mvanparking.apk 

The above command does not work with this error,

 3531 KB/s (13523837 bytes in 3.740s) pkg: /sdcard/tmp/com.furkan0gul.mvanparking.apk Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE] 

I have enough space (more than 6 GB of the total memory of 8 GB) on my external card. You can find this using the command below,

 >adb shell df Filesystem Size Used Free Blksize /dev 402M 64K 402M 4096 /mnt/asec 402M 0K 402M 4096 /mnt/obb 402M 0K 402M 4096 /system 1183M 907M 275M 4096 /cache 246M 4M 241M 4096 /persist 3M 80K 3M 4096 /firmware 63M 43M 19M 16384 /data 2101M 1401M 700M 4096 /lta-label 15M 4M 10M 4096 /storage/sdcard0 2101M 1401M 700M 4096 /storage/sdcard1 7572M 1088M 6483M 32768 

If I run the adb installation command without the "-s" switch, it will install completely in the internal memory without any problems, as shown below,

 > adb install C:\com.furkan0gul.mvanparking.apk 2549 KB/s (13523837 bytes in 5.180s) pkg: /data/local/tmp/com.furkan0gul.mvanparking.apk Success 

When installed on an SD card, the application seems to be installed in '/ sdcard', but there is no mounting of such a thing in the output of the "df" command. I also tried searching on this topic INSTALL_FAILED_INSUFFICIENT_STORAGE . Most of them asked to make some changes to the emulator to do this. I uninstalled the application, restarted the device and tried to install it again on the SD card, but it didn’t work, ending up with the same insufficient memory error.

I do not use an emulator. I just install apk in my SD card. I do not want to start the device and offer invalid warranties.

Appreciate if anyone can submit your ideas on this.

+6
source share
2 answers

There is a simple solution. If your test device is running Android 2.2 or later, add

 android:installLocation 

to the application manifest file with a value of "preferExternal". This will force the application to be installed on the external storage of the device, for example, on the phone’s SD card.

For instance:

  <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.dem" android:installLocation="preferExternal"> 
+3
source

I have a Fairphone (first edition) with a unified repository applied. The problem with INSTALL_FAILED_INSUFFICIENT_STORAGE should have been removed with unified storage. However, it appeared a few months later, despite having 12 GB of free disk space. For me, the following steps solved the problem

  • Install ssh server on your phone
  • entrance
  • su (if you are not root)
  • pm set-install-location 1 (installs to external memory)

Since I have enough space in internal memory, this is preferable to external memory (which I probably no longer see due to the unified storage). This may be characteristic of Fairphone.

0
source

All Articles