Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SD Card Transfer (not enough storage space)

I am trying to allow my app to be able to be moved to an SD card. So far, I have added the attribute, android:installLocation="auto", to my manifest file.

When I try moving storage option from internal to external for the app (75MB) on my phone, the option is there to move it, but it keeps showing a toast saying "Not enough storage space" after it is 90% complete, even though I have plenty of space in my internal (64 GB) and external (128 GB). I also tried moving a different app on my phone that was larger than (75MB), and the transfer worked. I also tried creating a virtual emulator to try transferring my app, but it's doing the same thing.

Is there an attribute that I am missing in the manifest file for this problem to be happening? Any suggestions?

like image 864
gnuhc Avatar asked Nov 08 '22 14:11

gnuhc


1 Answers

android:installLocation="auto" is the only line of code needed to make the app movable to the SD card.

But installing with ▶ Run, the "Not enough storage space" toast appears.

To actually move the app to the SD card, within Android Studio you have also to:

  • Create a signed package, release variant, with: Build > Generate Signed Bundle/APK... > APK
  • Install it from Terminal with: adb install -r path/to/my/app-release.apk
like image 103
Salvador Avatar answered Nov 14 '22 22:11

Salvador