Google Play Store insufficient storage error - android

I own a rooted Samsung Galaxy Tab 2 7.0 (GT-P3110). Im using Android 4.2.2 and Cyanogenmod 10.1.3-p3110.
Since a few days my tablets play store screws up installing some apps. I get an insufficient storage error after the installprocess starts everytime (when the download has ended). This occurred with youtube but strangely enough not with some barcodescanner app. When I look at my usage of internal storage however there seems to be more than 2 gigs of free space left.
The internet is full of people getting this error. I tried many solutions, but none of them seem to work. I tried to wipe the cache and dalvik cache. Also I tried to look at the free internal storage in different ways. Nothing seems to work. However I can put apks on my tablet via usb and then install them without any problems. This isnt really practical though.
Also updates are going fine too. I dont get this error when apps update automatically.
Edit: Also tried to fix permissions in Clockwordmod Recovery, didn't help
Edit 2: A copy of df command in terminal
u0_a40#android:/ $ su
u0_a40#android:/ # df
Filesystem Size Used Free Blksize
/dev 387.4M 48K 387.3M 4096
/storage 387.4M 0K 387.4M 4096
/storage/emulated 387.4M 0K 387.4M 4096
/storage/sdcard1 23.9G 32K 23.9G 16384
/mnt/secure 387.4M 0K 387.4M 4096
/mnt/asec 387.4M 0K 387.4M 4096
/mnt/obb 387.4M 0K 387.4M 4096
/mnt/fuse 387.4M 0K 387.4M 4096
/system 1.3G 374.9M 1003.1M 4096
/efs 19.7M 4.1M 15.5M 4096
/data 4.6G 2.5G 2.1G 4096
/cache 689M 70M 619M 4096
/mnt/shell/emulated 4.6G 2.5G 2.1G 4096
/storage/emulated/0 4.6G 2.5G 2.1G 4096
/storage/emulated/0/Android/obb 4.6G 2.5G 2.1G 4096
/storage/emulated/legacy 4.6G 2.5G 2.1G 4096
/storage/emulated/legacy/Android/obb 4.6G 2.5G 2.1G 4096
u0_a40#android:/ #

Navigate to settings->Apps->Running Apps and select "Google Play Services" click on uninstall latest updates and things should work again.This is a bug from google play and it creates multiple copies of your app directory in memory.

Going to Settings > Apps > Choose Google Play Services and then Clear Cache, worked for me!

Ended up flashing a new rom. I am using Slimkat 4.4.4 now and had to flash it using the latest Philz Touch which I found right here https://goo.im/devs/philz_touch/CWM_Advanced_Edition/p3110/
The problem now seems to have been solved, although I didnt prefer this particular solution. Oh well.

As far as I know, the only known "solution" for non-rooted devices whose cache and app data have already been wiped is to apply a factory reset.
If you change your mind and decide to root your phone, I suggest you install Android SDK Tools Only on your computer, then root your phone, go to Android's Settings, then Developer Options, then activate USB Debugging. After you do this, use a USB cable to connect your Android device to the computer where you installed the SDK tools.
The SDK tools have ADB (Android debugger). Open a shell window, go to the folder where the SDK tools were installed, look for a folder named platform-tools and access it. Inside this folder there will be an executable binary file named adb (or adb.exe, if you're using Windows). Then run the following command in order to make ADB access the command prompt of your Android device:
adb shell
Now that you're in your Android device shell (commands interpreter), run this command in order to become root (also known as superuser):
su -
Afterwards, run this command to check what's your system's default APK install location:
pm get-install-location
If the command above returns 2, it means that the Android package manager (pm) is incorrectly configured to install APKs in your external storage (e.g. microSD card) instead of in your device's internal storage (which is the correct one).
In order to fix it, run this command:
pm set-install-location 1
1 means internal storage media.
Now restart your device with this command:
reboot

Related

Resize data partition which does not match physical storage size after installation of Android stock and Lineage

After an attempt to install Lineageos+Magisk on a Xiaomi Mi A1, ended in a boot loop,
I installed stock from tissot_images_V10.0.9.0.PDHMIXM_20190514.0000.00_9.0_3ded3e7b82.tgz with containing flash_all.sh which applies fastboot. I got a working starting point with a tidy a/b partitioning.
I flashed Lineage, addonsu and stock camera with a temporary (unflashed) TWRP
Everything works well but there is too little storage, Lineage displays a size of 32GB instead of 64GB
df tells me: /dev/block/mmcblk0p49 19092180 15660496 3431684 83% /data
but blockdev --getsize64 /dev/block/mmcblk0p49 reports 55087439360 (bytes)
I mounted the userdata.img from the stock firmware mentioned above on my Linux PC and df showed me
/dev/loop1 19092180 118172 18762328 1% /mnt/...
This seems to be the source of the problem, isn't it?
(How) can I resize the partition / file system (preferably) without loosing data)?
I found a solution for my problem.
TWRP has added resize2fs to its features:
https://www.theandroidsoul.com/twrp-2-8-7-0-introduces-resize2fs-feature-to-fix-incorrect-storage-space-available-on-a-device/
So I started TWRP
sudo fastboot boot twrp-3.3.0-1-tissot.img
In TWRP I launched command line and with a single command
resize2fs /dev/block/mmcblk0p49 <newsize>
the problem was solved. I did not extend to the full size of the partition but left some MBs (at the end) because I seem to remember having read that this space is necessary for meta data when encrypting the device.

How to create a working AVD for Jellybean (API 17)?

I attempted to create an AVD for Jellybean (API 17) in Kubuntu 17.04 using the following procedure:
Launch the AVD Manager from Android Studio
Click the "Create Virtual Device" button:
Select the Nexus 4 hardware profile:
Click "Next"
Click the "x86 Images" tab and select "Jelly Bean / 17 / x86 / Android 4.2 (with Google APIs)" image:
Click "Next"
Leave the settings at their defaults:
Click "Finish"
Now, due to an unfortunate issue with Ubuntu 17.04 (and its derivatives), it is not possible to launch the emulator directly by clicking the play button next to its entry. (Clicking it does nothing.) Instead, I must launch the emulator from the terminal with:
$ cd ~/Android/Sdk/tools
$ LD_PRELOAD='/usr/$LIB/libstdc++.so.6' ./emulator -avd Nexus_4_API_17
The emulator starts and the home screen appears:
However, interacting with it immediately reveals that there is a problem. The camera displays an error:
Clicking on "Storage" in the Settings app causes the Settings app to crash.
What did I do wrong and how can I fix this?
Edit: I clicked "Show Advanced Settings" and confirmed that an SD card was indeed to be created:
I also confirmed that the file ~/.android/avd/Nexus_4_API_17.avd/sdcard.img.qcow2 exists.
Edit: I followed the same procedure to create a Kit Kat AVD (using the Nexus 5 hardware profile) and the issue is not present there. The SD card works as expected.
Edit: I tried using mksdcard to manually create an SD card image:
mksdcard -l TEST 100M sdcard.img
...and then passing it directly to the emulator:
emulator -sdcard sdcard.img -avd [...]
...but this made no difference.
However, I discovered something interesting after opening a root terminal on the device (using adb shell) and running the mount and df commands:
# mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
/dev/block/vda /system ext4 ro,relatime,data=ordered 0 0
/dev/block/vdb /cache ext4 rw,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
/dev/block/vdc /data ext4 rw,nosuid,nodev,noatime,errors=panic,data=ordered 0 0
# df
Filesystem Size Used Free Blksize
/dev 757M 68K 757M 4096
/mnt/secure 757M 0K 757M 4096
/mnt/asec 757M 0K 757M 4096
/mnt/obb 757M 0K 757M 4096
/system 532M 349M 183M 4096
/cache 60M 40K 60M 4096
/data 1G 75M 1G 4096
It appears as if the SD card isn't being mounted, since /dev/block/vdd is missing in the output above and none of the partitions have a capacity of 100M.
After some research I'm ended up to an answer: JellyBean is too old to be used on recent emulator.
If you want to continue to use this system and wanto to use also the sd card, this can be a nice workaound for you.
Launch manually the emulator as:
cd ~/Android/Sdk/emulator
LD_PRELOAD='/usr/$LIB/libstdc++.so.6' ./emulator #Nexus_4_API_17 -verbose -engine classic
Note the -engine classic that will load the old/classic qemu with kernel kerne-qemu instead of new qemu2 with kernel kernel-ranchu (available options are: auto, classic, qemu2)
try using Genymotion. it much faster.
Genymotion operation relies on the use of Oracle VM VirtualBox in the background. This enables virtualizing Android operating systems. If you do not already have Oracle VM VirtualBox installed, you will be asked to do so prior to installing Genymotion.
When you create an AVD it's possible to say whether to emulate SDCard or not (and of what size). Looks like you simply did not specify the SDCard presence. Edit your AVD settings and make sure you have explicitly requested for SDCard support. I think this options in Advanced settings in your step 7.
For settings issue
Edit the hardware profile and change the dimensions to 4.2 inches(Not sure Why? But i think upto 17 max resolution available was 4.2 inches).
Reboot the device
Your settings will start working.
For camera
The issue is the file system which is in read only mode. You need to change the file system. Check this link.
After changing the file system push few images and restart.
Another issue i found that there is no DCIM folder present.
Try creating the /mnt/sdcard/DCIM and add few images too.
Reboot again. Everything will start working.
You can use genymotion:
https://www.genymotion.com/
Genymotion is an emulator using x86 architecture virtualization,
making it much more efficient!
Taking advantage of OpenGL hardware acceleration, it allows you to
test your applications with amazing 3D performance
http://hackpundit.com/android-emulator-genymotion-installation/

how to mount a ntfs volume for all users with rw permissions with ntfs-3g binary?

I am using a cross compiled binary for android.
I used a command
ntfs-3g /dev/block/mmcblk1 /storage/sdcard0/mysdcard
However when i exit the superuser and become a normal user. I am not able to view the device mounted on sdcard 3. I am only able to browse the filesystem as a root user. How do i mount the drive for all users publicly?
my experience with ntfs-3g in linux is with Suse,
and I recently downloaded the source for ntfs-3g_ntfsprogs-2017.3.23.
Going from memory I built it from source I think by simply
./configure --prefix=/opt/ntfs-3g_ntfsprogs-2017.3.23
make
make install
in any case if that is not correct there is either a README or INSTALL file explaining what to do.
After that I added /opt/ntfs-3g_ntfsprogs-2017.3.23 to /etc/ld.so.conf and also to LD_LIBRARY_PATH and uninstalled the system installed version of ntfs-3g so I know I was using the new version.
I could then successfully mount by hitachi 3tb hard disk I had formatted as ntfs from Windows 10 Home edition.
In linux in /etc/fstab my default mount line for mounting by device_id was this
/dev/disk/by-id/ata-Hitachi_HDS723030ALA640_MK0311YHGWTYNA-part2 /data ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
this resulted in my disk mounting under a /data folder but because of fmask and dmask only root could get into the /data folder.
set fmask=111 and dmask=000 to make all files -rw-rw-rw and all directories drwxrwxrwx.
again, this was with the latest ntfs-3g_ntfsprogs-2017.3.23 that was available as of 2018-02-24. I do not know if dmask and fmask are new features in ntfs-3g, i don't remember noticing them in earlier versions where it just worked. I mention all this because in SLES 11.4 the native version of ntfs-3g from the SDK works and it mounts my win10 ntfs data drive no problem, but in SLES 12.3 whatever that native ntfs-3g from the SDK was did not work, gave error -1003 or -3003, thus the manual update to latest ntfs-3g and noticing the extra security preventing default read/write access to the mounted drive... requiring the modification of fmask and dmask

adb install fails with error 'INSTALL_FAILED_INSUFFICIENT_STORAGE'

I have bought my first Android mobile Sony Xperia M without being aware of the issue that we can't move apps to external sd card. Refer this link for details.
The only thing Sony advice is to root the device, partition and use third party apps to move it. They also mention that rooting may void warranty.
My Android Details of Sony Xperia M is listed below
Model number C1904
Android version 4.1.2
Build number 15.1.C.2.8
I have tried running the below commands from some forum and it is not working for me,
adb devices
adb shell pm get-install-location
adb shell pm set-install-location 2
Though the above commands doesn't prompt any error and I can get the install location as 2 (with adb shell pm get-install-location). So I believe it has set properly. But then I tried installing some apps and it is only installing in the internal memory only.
I have tried 'apps2sd' utility to move my apps and it is showing the below error,
'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 through 'adb install' command to install directly into the sd card as below,
adb install -s C:\com.furkan0gul.mvanparking.apk
The above command fails 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 6GB out of total 8GB memory) in my external card. You can find this using below command,
>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 install command without '-s' switch, it installs fine in internal memory without any issues as 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
While installing to sd card, app seems to be installed in '/sdcard', but no mount of such thing there in 'df' command output. Also tried searching this 'INSTALL_FAILED_INSUFFICIENT_STORAGE' by google. Most of them asked to do some changes in emulator to get this done. I have uninstalled the app, restarted the device and tried installing again into sd card but not working ended with the same insufficient storage error.
I am not using emulator. I am just directly installing apk into my sd card. I dont want to root the device and void warranty offer.
Appreciate if some one could send your ideas on this.
There is a simple workaround.If your test device is running Android 2.2 or later then add the
android:installLocation
attribute to your application's manifest file, with the value "preferExternal". This will force the app to be installed on the device's external storage, such as a phone's SD card.
For example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dem"
android:installLocation="preferExternal">
I have a Fairphone (first edition) with applied unified storage. The INSTALL_FAILED_INSUFFICIENT_STORAGE problem should have been gone with the unified storage. Nevertheless, it showed up after a few month despite having 12gb of free disk space. For me, the following steps solved the issue
Install an ssh server on your phone
Login
su (in case you're not root)
pm set-install-location 1 (set to external memory)
Since I HAVE enough space on the internal memory, this is preferred over the external memory (which I probably don't have anymore due to the unified storage). This might be specific to the Fairphone

Unable to change permission of the sdcard(emulator),can any1 guide me how to change them?

the permission of my sdcard is Irwxrwxrwx
i am unable to push any files in it
Android Emulator sdcard push error: Read-only file system
how to change permission of DDMS / File Explorer / sdcard?
Change file permissions in DDMS (Android)
i have gone through many questions some of them have been posted above,they didn't help..
i even tried getting an image from a friend,with read/write permissions but that didn't help either.
Sometimes the problem comes for something simpler: my SD Card was FAT32 formated and this problem finished when I changed the filesystem to NTFS.
You first need to create an SD Card image. This can be done in the AVD Manager at the same time as creating the AVD image.
The SD Card image has to be mounted too (i.e. if you use an already mounted SD Card). When no card is mounted, /sdcard is treated as a folder of /system. So when you try to write to /sdcard on an AVD image without an SD Card mounted it tries to write to /system which is read-only.
Update:
Make sure your SD card is mounted correctly. Use adb shell (or adb shell emulator-5554 when your real device is also plugged in) and enter df in the shell.
The output should look like this
Filesystem Size Used Free Blksize
/dev 378M 32K 378M 4096
/mnt/asec 378M 0K 378M 4096
/mnt/obb 378M 0K 378M 4096
/system 194M 191M 2M 4096
/data 194M 8M 185M 4096
/cache 64M 1M 62M 4096
/mnt/sdcard 246M 6K 246M 512
/mnt/secure/asec 246M 6K 246M 512
Make sure that this two lines are present.
/mnt/sdcard 246M 6K 246M 512
/mnt/secure/asec 246M 6K 246M 512
This means, that the SD Card is mounted correctly.
That being said: DO NOT IN ANY CASES NEVER EVER USE HARDCODED /sdcard/... PATHES. Always use Envirnoment.getExternalStorageDevice() (for multi-user) or Environment.getExternalStoragePublicDirectory (String type) (for public folders accessible to all users)
For Clarification: The SD Card is mounted in a different physical path depending on manufacturer of the ROM. Back when Android first appeared, all external cards where mounted by default in /sdcard since back then all devices had small internal memory and SD-Card slots.
Newer Android Smartphones often ship without an SD Card. The newerones with 1-16 GB internal memory, like tablets, do not mount to /sdcard instead they mount by default to /mnt/sdcard. But it also depends on vendors. One vendor use one way over the other way. Tablets w/o SD Card for example use part of the internal storage to mount to the old /sdcard for compatibility reasons. Always use the API to get the path to internal storage memory!
Envirnoment | Android Developers
http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29
or
http://developer.android.com/reference/android/os/Environment.html#getExternalStoragePublicDirectory%28java.lang.String%29

Categories

Resources