MultiROM Once Again Available for the Galaxy S4

Multiboot, or the ability to select betweenmultiple operating systems on a single device at … more

Build an Impractical But Awesome Lego Mindstorm Dock

The vast majority of what we cover here on the XDA-Developers News Portal relates to … more

MultiROM Makes its Way Over to the HTC One (M8)

While browsing our forum, you will undoubtedly find more than a few enticing ROMs available … more

Welcome to the New XDA-Developers Portal!

You may recall that a few weeks ago, we opened up the XDA-2015 forum themesto intrepid users … more
Post Reply

[Solved] Market Error "Invalid Package File"

12th January 2011, 11:45 PM   |  #1  
OP Senior Member
Thanks Meter: 15
 
242 posts
Join Date:Joined: Jun 2010
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/show...28&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.
Last edited by sw99; 4th March 2011 at 02:42 AM.
The Following User Says Thank You to sw99 For This Useful Post: [ View ]
17th January 2011, 09:11 AM   |  #2  
Seandeezy's Avatar
Member
Flag Anaheim
Thanks Meter: 2
 
73 posts
Join Date:Joined: Jan 2011
More
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?
17th January 2011, 11:01 AM   |  #3  
OP Senior Member
Thanks Meter: 15
 
242 posts
Join Date:Joined: Jun 2010
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.
25th February 2011, 12:35 PM   |  #4  
Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: Jan 2011
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
25th February 2011, 01:02 PM   |  #5  
sgt. slaughter's Avatar
Retired Forum Moderator
Flag Raleigh
Thanks Meter: 2,899
 
5,630 posts
Join Date:Joined: Jun 2010
More
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.
25th February 2011, 02:15 PM   |  #6  
OP Senior Member
Thanks Meter: 15
 
242 posts
Join Date:Joined: Jun 2010
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.
25th February 2011, 04:01 PM   |  #7  
sgt. slaughter's Avatar
Retired Forum Moderator
Flag Raleigh
Thanks Meter: 2,899
 
5,630 posts
Join Date:Joined: Jun 2010
More
oughta try reformating your SD card and let the phone reformat it too.
25th February 2011, 07:04 PM   |  #8  
OP Senior Member
Thanks Meter: 15
 
242 posts
Join Date:Joined: Jun 2010
Quote:
Originally Posted by sgt. slaughter

oughta try reformating your SD card and let the phone reformat it too.

don't see why this is different than un-mounting the SD which should do the same thing and has been tried.
25th February 2011, 07:27 PM   |  #9  
sgt. slaughter's Avatar
Retired Forum Moderator
Flag Raleigh
Thanks Meter: 2,899
 
5,630 posts
Join Date:Joined: Jun 2010
More
Quote:
Originally Posted by sw99

don't see why this is different than un-mounting the SD which should do the same thing and has been tried.

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.
4th March 2011, 03:59 AM   |  #10  
OP Senior Member
Thanks Meter: 15
 
242 posts
Join Date:Joined: Jun 2010
Found the problem, updated in OP.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes