I've been having this problem on and off for a while, mostly I believed it was related to something getting corrupted when I restored my apps to a new Rom with Titanium Backup.
I am happy to say, that after scouring the web for days, and trying a lot of wrong information, I finally figured out how to fix this.
It's real easy. All you need to do is remove any *.apk files located in the /cache directory on your phone (did not even need to remount- though I did it as root just in case).
I never did figure out why only some apps will have this problem or how the problem first comes about, but I have successfully done this twice and have since been able to install/update files that had this error before.
Update (3/3/11): OK - After scouring the Internet for over a month I finally figured it out. My info above was only part right. The problem is specifically with ROMs/Kernels that move the dalvik-cache to the /cache directory (HTC puts it in the /data dir).
In any case, when it's in /data, it is using app space, and therefore you usually run out of app space and know about it. However, because this is in /cache, you don't really know what you are using. As you load up on apps, your dalvik-cache grows, and since these apps need the .dex files in the cache, even if you clear your cache, it will just get re-created.
the /cache dir is also where the apps are temporarily stored while downloading from the market. So....
1. If you are getting immediate download fails, that means that your cache is so full that you don't even have space for the temp file.
2. If you get "Invalid Package" that likely means that there was not enough cache left to install the .dex files (the download is also taking up some of this space).
Unfortunately, the only way to fix this is to either remove some of your apps, or move your cache to your SD card.
HOWEVER, I found this great app on the market called Link2SD, that allows you to only move select apps to the SD card, and you can also move the dalvik-cache files associated with these apps.
see this thread for specifics: http://forum.xda-developers.com/showpost.php?p=10711328&postcount=1
it lets you select which apps to move. You will need to create a new partition on your card, though.
So far results have been great and I can finally update the 30+ apps that have been stuck for me for the last 2 months.
almost forgot, if you adb shell or use terminal emulator, you can type "df" to see how much space is left on all your mounts.
My phone has been doing the same thing with the whole package file is invalid bs. I tried to follow your instructions on going to the /cache folder. When I went to the folder, it was empty, so I wasn't able to remove any .apk files. So now what? How do I fix this?
If you use a File Managemet app like ASTRO, it will show the folder as empty because you need root access to see the dir. However, if you use Terminal Emulator or adb shell (as root) you will see that there are indeed other directories, and probably these orphaned .apk files.
Hi,
I'm also having the same issue with invalid package. I cleared the /cahch direcotry and still have the issue -- Is there something else i can try before wiping and starting over?
thanks
Rudey
It could also be caused by the .android_secure folder on your SD card. Clearing this folder and letting the market restore them solves issues a lot ofthe time.
As always use TiBackup or something to backup all your apps first too to be safe.
As the OP, I can tell you that I have, in fact, been unable to fix this problem.
Initially the suggestion I posted above worked, however a couple of days later is was no longer working again.
I have tried every trick on the web, including:
1. Removing SD card.
2. Deleting the above mentioned folder
3. clearing market cache
4. Clearing all caches in recovery
5. logging out and back in to google talk.
The only thing that fixes it is a complete factory reset.
I currently have a combination of 3 errors:
1. No download at all.
2. Download unsuccessful
3. Invalid Package
some apps will still update, but what is really weird is that I am even getting invalid package on new apps (so its not a corrupt app already installed on the phone).
One last thought. Once I am unable to update an app, even if I remove it, I can no longer restore the backup using Titanium.
oughta try reformating your SD card and let the phone reformat it too.
sgt. slaughter said:
oughta try reformating your SD card and let the phone reformat it too.
Click to expand...
Click to collapse
don't see why this is different than un-mounting the SD which should do the same thing and has been tried.
sw99 said:
don't see why this is different than un-mounting the SD which should do the same thing and has been tried.
Click to expand...
Click to collapse
na actually reformating it will fully wipe everything on the SD and having the phone do it is best always as its always better to format with the device your using the disk on the most in general.
Found the problem, updated in OP.
sw99 said:
I've been having this problem on and off for a while, mostly I believed it was related to something getting corrupted when I restored my apps to a new Rom with Titanium Backup.
I am happy to say, that after scouring the web for days, and trying a lot of wrong information, I finally figured out how to fix this.
It's real easy. All you need to do is remove any *.apk files located in the /cache directory on your phone (did not even need to remount- though I did it as root just in case).
I never did figure out why only some apps will have this problem or how the problem first comes about, but I have successfully done this twice and have since been able to install/update files that had this error before.
Update (3/3/11): OK - After scouring the Internet for over a month I finally figured it out. My info above was only part right. The problem is specifically with ROMs/Kernels that move the dalvik-cache to the /cache directory (HTC puts it in the /data dir).
In any case, when it's in /data, it is using app space, and therefore you usually run out of app space and know about it. However, because this is in /cache, you don't really know what you are using. As you load up on apps, your dalvik-cache grows, and since these apps need the .dex files in the cache, even if you clear your cache, it will just get re-created.
the /cache dir is also where the apps are temporarily stored while downloading from the market. So....
1. If you are getting immediate download fails, that means that your cache is so full that you don't even have space for the temp file.
2. If you get "Invalid Package" that likely means that there was not enough cache left to install the .dex files (the download is also taking up some of this space).
Unfortunately, the only way to fix this is to either remove some of your apps, or move your cache to your SD card.
HOWEVER, I found this great app on the market called Link2SD, that allows you to only move select apps to the SD card, and you can also move the dalvik-cache files associated with these apps.
see this thread for specifics: http://forum.xda-developers.com/showpost.php?p=10711328&postcount=1
it lets you select which apps to move. You will need to create a new partition on your card, though.
So far results have been great and I can finally update the 30+ apps that have been stuck for me for the last 2 months.
almost forgot, if you adb shell or use terminal emulator, you can type "df" to see how much space is left on all your mounts.
Click to expand...
Click to collapse
Didnt solve my issue.. I had reformatted my phone and SD card and reinstalled my apps. It was working fine again but now its back to some apps update fine.. some get DOWNLOAD UNSUCCESSFUL and some get PACKAGE FILE INVALID.. any ideas.. Im on sprint lovers rom (latest)
It appears th LINK 2 SD needs a second partition that I dont have nor use with SPRINT LOVERS ROM and 2.2 .... am I missing something??
To the OP,
The program you linked to seems to be a variation of dark tremor's a2sd method (http://forum.xda-developers.com/showthread.php?t=715116). His lets you move data, cache, and/or dc to the ext partition, but doesn't (at least I don't believe it does) give you granular control over which apps remain in the standard location.
In my own use, I chose to move all user installed apps to sd, but dc remained on the internal memory (albeit, not in /data, but in the /cache partition). I figured this way, even if the sd card is missing, the phone will still boot. I won't have access to anything I installed, but whatever the rom came with will still be accessible.
Follow the instructions on that thread and create the second partition. You won't need more than 500mb. apps2sd or link2sd is the only way you can fix this problem unless you want to remove some of your apps.
Sent from my PC36100 using XDA App
gpz1100 said:
To the OP,
The program you linked to seems to be a variation of dark tremor's a2sd method (http://forum.xda-developers.com/showthread.php?t=715116). His lets you move data, cache, and/or dc to the ext partition, but doesn't (at least I don't believe it does) give you granular control over which apps remain in the standard location.
In my own use, I chose to move all user installed apps to sd, but dc remained on the internal memory (albeit, not in /data, but in the /cache partition). I figured this way, even if the sd card is missing, the phone will still boot. I won't have access to anything I installed, but whatever the rom came with will still be accessible.
Click to expand...
Click to collapse
Yes that's true, and I eventually went the app2sd route. However, I was trying to avoid that because of the slow speed of my sd card.
Sent from my PC36100 using XDA App
sw99 said:
Yes that's true, and I eventually went the app2sd route. However, I was trying to avoid that because of the slow speed of my sd card.
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
I'm not sure which app2sd method you're referring to, but keep the following in mind. I discovered this after my backup images failed to restore properly.
In the past, i'd be backing up boot, system, and data partitions. Obviously with dt's a2sd, I need to include the ext partition now. No problem. BUT, when restoring, i'd run into issues where my apps were present, but all settings were lost. After much confusion and head scratching, I tried wiping cache and dc AFTER the restore, but before the initial boot. The restore was a success now!
Apparently, with a2sd on the ext3, some remnants of cache or dc remain when backing up, even if cache is not selected. As part of any good restore, first thing is to always wipe, so now we end up with a hodge podge of files in the cache which I think causes the OS to revert all the settings back to default.
Just something to keep in mind.
i wanted to go back how my dhd was.. lots of problem.. i havent fix my radio problem yet and now this invaled package thing *face palm*
My phone is HTC G7, and I use data2sd to get 1.5G rom space, now there is still about 1.2G left, but I also met the "invalid package file" problem. I can't find any *.apk in /cache, (root, with "ls -a"). But if I uninstall some apps, I could install or update other apps successfully. I could not use Link2sd for I already have data2sd and I guess it's not a problem of insufficient space, because I still have enough rom space.
Do you have any new solutions?
supericexu said:
My phone is HTC G7, and I use data2sd to get 1.5G rom space, now there is still about 1.2G left, but I also met the "invalid package file" problem. I can't find any *.apk in /cache, (root, with "ls -a"). But if I uninstall some apps, I could install or update other apps successfully. I could not use Link2sd for I already have data2sd and I guess it's not a problem of insufficient space, because I still have enough rom space.
Do you have any new solutions?
Click to expand...
Click to collapse
The problem is not the apps, its the /cache running out of space. I suspect that the app you are using cannot move the dalvik-cache files (and is really just a shortcut to android's app2sd - which is not the same as darktremor or link2sd).
in terminal us df -k to see how much space you have on each mount to confirm that there is little space in cache.
If you really have that much space in your apps mount, then I would suggest moving the dalvik-cache back to its original location (search for instructions, as the only way I know how to do it is by installing darktremor's app2sd). If you are still having problems, you really are limited to either partitioning your SD card and using apps2sd or link2sd or removing apps.
hope this helps.
I have been having this issue for a couple of months now - with a bit of a twist. After wiping my dalvik-cache, my apps began to sucsessfully update - except for Google apps.
I have no idea why just those apps, but going into settings/Applications/Manage applications, and selecting each app, then clearing that apps cache, allowed those apps to sucessfully update also.
I am thankful I did not have to resort to the above fix.
Any solution if not rooted?
I've just started to get this error when trying to update the Google+ app. The error is only happening with Google+, every other app I update/install works fine.
I haven't rooted my device, and I'm hoping there's a way to fix the issue without rooting?
Device: Nexus One
Rom: Stock Android
Version: 2.3.4
Although I couldn't see anything in the cache directories, I checked in /system/app and couldn't find any package that looked like it would be Google+.
Due to the fact that I can't directly reply to the thread that was created because I don't have enough posts, I'm posting here looking for an answer.
I followed the advice in this post. The only difference is that I used Super Manager instead of Root Explorer to delete the files from /system/app/.
Here is the odd part, after finishing I rebooted and when I powered back up and checked my available memory, it didn't change at all. Naturally I went back in with Super Manager and checked for the files and they are not there. I also looked with Astro File Manager and the files were not in /system/app/. I don't understand that if I deleted the files, why didn't my available memory increase? That is the whole reason I removed.
Thanks,
Why do you need more space in system folder?...
Go in data folder and check dalvick and data folders for leftovers.
Sent from my S7 using Tapatalk
Removing the so-called "bloatware" won't free up app storage space.
The tablet uses different partitions to store different things. System applications are stored on a different partition than user-installed apps. They each have their own space, indepentantly of each other.
When I started this exercise in removing the "bloatware" from my S7, I had a little over 85 MB free from the 175 MB available. After removing the "bloatware" I didn't see a change. Over the weekend, I removed the battery from my S7 to check the version number. After starting the S7 again, I check the memory and I now have 101 MB free. The only change was to remove the "bloatware". After installing two more apps on the tablet and moving the .apk file to my Link2SD partition on the internal SD card, I now have 98.97 MB of available space.
For the other post about removing the cache, I just ran cachemate and now I have 105 MB of available space.
Removing the "bloatware" does have an effect on the available memory.
While I did restart my S7 after removing the "bloatware", I didn't remove the battery. I don't know what I had the difference, but by completely removing the battery I saw that I had more space available after removing the "bloatware".
Couldn't have been. All of the apps you deleted reside in /system/app. That's on a completely separate partition from /data.
/data is where apps you install from Market go. It's also the space listed under "Internal Tablet Storage".
/system is where the system core files (and any pre-bundled apps) reside. There is no way to see the space free/used without going into a root terminal and running "df -h"
There is no way deleting system applications freed any sort of space on your /data partition.
It would be like if you had two hard drives in your computer, labled C:\ and D:\. Why would deleting files from C:\ free space on D:\? It's the same concept.
Ok. I understand what you are saying. However, I'm just reporting what I see when I look under:
Internal Tablet Storage
Total Space = 175 MB
Available Space = 100 MB
After removing the .apk "bloatware" files from /system/apps the available space increased.
tedkitch said:
Ok. I understand what you are saying. However, I'm just reporting what I see when I look under:
Internal Tablet Storage
Total Space = 175 MB
Available Space = 100 MB
After removing the .apk "bloatware" files from /system/apps the available space increased.
Click to expand...
Click to collapse
he's just being hostile and doesn't understand...
the bloatware resides in /system... now some of those files are Maps.apk which is an outdated version, and when you update it to the newest version from the market it installs to /data...
now...
it says it is updated, but we still have the outdated version which is still in /system taking up INTERNAL space. removing that apk from within /system and rebooting will add that much more space to your internal and the maps will still be installed because they are updated and installed to /data.
if you want to be so high and mighty, think before you talk.
also... data is installed internally, hence why we have the a2sd or links2sd method.
joenilan said:
it says it is updated, but we still have the outdated version which is still in /system taking up INTERNAL space. removing that apk from within /system and rebooting will add that much more space to your internal and the maps will still be installed because they are updated and installed to /data.
if you want to be so high and mighty, think before you talk.
Click to expand...
Click to collapse
I think you need to think before you talk.
Space on /system is not (normally) accessible to the user to use for storage of any kind. It's reserved solely for the OS' system files to be stored.
I think this is where you all are getting confused. Yes, the entire storage (including the internal storage) is all on the same flash ROM chip. But, it's not all contiguous space. It's broken up into partitions, and changes you make to a single partition does not affect any of the other partitions.
I'm not TRYING to be hostile, and I understand more than you think I do. I understand the underlying Android OS' mounts, whereas it seems you do not.
If you had said "removing these apps keeps them from running and using up CPU cycles and ram" I wouldn't have an issue with it. But, saying they free up space for the user to install apps to is just plain wrong.
My Phone's internal memory gets used up when i download some application from the android market(which is quite obvious) , but after it gets installed , the applicaion's setup file still uses internal memory along with installed files ..
is there any way clean up these downloaded setup files ..
Please please please help me .. i am running short of memory here inspite of APP2SD ..
i doubt it. its all in the apk file so i would assume that you couldnt separate the set up files from the actual application just because its really all one file. i mean you could use 7-zip and looked inside the apk file and you would see other files but you would still need the set up file to be able to install and set it up. right? besides i think this file would be very small anyway.
i agree with u that apk file can't be moved or deleted from mnt/asec/ ..
but i don't know why the downloaded setup file still uses the memory along with the installed files (apk and others) .. i mean either the setup file shud be moved to asec or it shud get deleted .. the application uses double space
and i have tested it too .. i used some apks stored in my SD card to install the applications .. and the space used by them was as much as expected .. (i didnt have ext 3/ext4 partition at that time to install them on SD card direct) ...
and when i downloaded the same app from market and installed it .. it used more memory!!
Now here's what i did to free up memory .. i downloaded all the required apks in sd card and used CWM recovery to factor reset and clean dalvik cache ,, plus i made a ext4 partition on SD card for A2SD+ ..
This way only nominal internal memory is used by apps ..
But this way i would never want to use android market to download and install apps .. thats why i need a way to clean my downloaded setup files and install the apps to SD card using A2SD+
When i Download something from the market the setup files often stay under the cache folder. You can delete them with root explorer or something like that to get more free space.
rauschkugl said:
When i Download something from the market the setup files often stay under the cache folder. You can delete them with root explorer or something like that to get more free space.
Click to expand...
Click to collapse
thanks for the suggestion .. will try it
Hi. Did my usual +3 hours googling but came empty handed.
Could size-agnostic CM7 SD installer script be modified so that /Data partition is set to 2Gb instead of 1Gb? I know that I can always do the "move to SD" routine but Android keeps bugging me that I`m out of space even when I have 170Mb free on /data. And also moving apps back and forth from internal to SD somehow wrecked my system process. As a result I now have constant rebooting of the launcher as my only Android experience. Uninstalling recent apps did not work. Neither did freeing up space on SD and denying root to all apps that previously asked for it.
zuzka said:
Hi. Did my usual +3 hours googling but came empty handed.
Could size-agnostic CM7 SD installer script be modified so that /Data partition is set to 2Gb instead of 1Gb? I know that I can always do the "move to SD" routine but Android keeps bugging me that I`m out of space even when I have 170Mb free on /data. And also moving apps back and forth from internal to SD somehow wrecked my system process. As a result I now have constant rebooting of the launcher as my only Android experience. Uninstalling recent apps did not work. Neither did freeing up space on SD and denying root to all apps that previously asked for it.
Click to expand...
Click to collapse
If you are willing to start from scratch you can burn the image again to the SD, but don't put any zips in it. Boot and let the script create the new partitions. Then put the card back in the PC and use Mini-Tool Partition Manager to shrink partition 4 (sdcard) and grow partition 3 (data) That program will handle the ext partition (3) as long as there is no data written to it yet. You can get that program free on the internet. Do a Titianium backup of your apps and data and restore later.
Edit: Now after thinking about it, you may be able to doctor your existing card. Partition 4 is fat so you can shrink it with data in it. Take the space off the front. Then I think the program will let you grow partition 3 into the empty space even with data already in it. It is just trying to move it with data does the program balk. Windows does not know how to read ext. Of course if you are running linux, just use gparted to do everything.
Yes, you could do that or you could use a program like easeus partition manager and move the partitions around after the first boot of the card.
Edit (while typing): It looks like you might be talking about an internal installation in which case you don't need to use size agnostic SD installer. Just repartition the internal the way you want it (there are threads for this) then flash your CM7.
Edit 2: beat out by leapinlar while editing 1
JP
Thanks for the idea of repartitioning prior to installing CM7. I`ll also try to repartition SD the way it is now- with data. I was concerned that /data partition is unmountable under Ubuntu when /boot and /system can be read without problems.
Hi again. I`ve managed to srink /sdcard partition under Windows and sort of grow /data partition under Ubuntu LiveCD (gparted froze right after doing its magic).
Boot loop on my Nook stopped as free space on /data increased from 175Mb to 1.2Gb. So I guess I wont be doing a fresh install at the moment.
Question is, exactly how much free space does CM7 need on /data partition? In a real world?
(at ~200Mb it starts bugging me about free space but overall Android stays stable)
zuzka said:
Question is, exactly how much free space does CM7 need on /data partition? In a real world?
(at ~200Mb it starts bugging me about free space but overall Android stays stable)
Click to expand...
Click to collapse
Original Nook Color had 1GB for data. B&N upped it to 5GB on the new Nook Colors. I personally would make it 2GB unless you are going to be adding some really big apps.
Sent from my Nook Color running ICS and Tapatalk
Ive found a way to install apps on my desire even if it says that im out of memory. When it says that its almost out of memory it means that it isnt so much space left in the data partition of the phone.
However i have seen that i have like 130 mb space left in my system partition.
The system partition is much like the data partition. The difference is that this partition holds the system apps like contact app, camera app, gallery app, settings app and so on...
Data partition unlike the system partition holds apps that are install/uninstallable. Still if you have root and have root explorer installed then you can see if you have much storage left in your system partition. I would recommend that you have about 100 mb storage left cuz then you can surely use this method.
NOTE:
This isnt garanteed 100% that it will work and for that i recommend that you do a backup of your current rom. And leave a bit space in system partition incase it needs some space. I leave 20 mb space and its working out for me fine.
So what we are gonna do is that we are gonna move our apps or games to the system partition as if it would be a system app and we are gonna use that extra space.
Requirements: Root, S-OFF, recovery, root explorer installed, the apk files of the apps you wabt to move (use a apk manager to make a apk file from your installed apps)
1. Backup your current rom using a recovery.
2. Open root explorer and grant the root access permission.
3. Go to sdcard/ and copy the apk files of the apps that you want to move
4. Go back out of the sdcard and go to system/app/
5. Here make sure you tap on the button in the upper right corner that says Mount R/W
6. Paste the apk files here and rename them to some simple name for example rename com.imangi.templerun.apk to TempleRun.apk
7. After youve done everything in the right order just reboot and your apps should appear in your apps list and you wont be able to move them to sdcard or uninstall them. Incase you have the apps that want to move already installed then uninstall them before the restart.
Only way to remove these apps is to remove the apk files from system/app folder using root manager while the system is mounted as r/w. After a restart the apps should be gone.
If anything goes wrong then just format the system partition and restore it using recovery.
Hope some of you find this helpfull
BTW: this does not work with viber so done even try or you will get unlimited crashes that wont stop viber from trying to start.
Sent from my HTC Desire with R2 ZM4.3 ICS Themed GB Rom using xda premium
Quick question:
I'm on a MIUI based rom, and my /system/app only has 11Mb free. I'm assuming that I can't increase that without losing some important apps?
Well i have never encountered a rom that has less than 50 mb space there. I assume that you have too many apps there. See if you can clean that folder up a bit by searching for apps that you think arent necessary. Like for example i have a app called adaway.apk. I dont need it nor does the system need it. If u cannot do that then change rom.
Btw more apps that donr work with this: SetCPU, Viber
Sent from my HTC Desire with R2 ZM4.3 ICS Themed GB Rom using xda premium