5,598,297 Members 47,707 Now Online
XDA Developers Android and Mobile Development Forum

[Solved] Market Error "Invalid Package File"

Tip us?
 
sw99
Old
(Last edited by sw99; 4th March 2011 at 02:42 AM.)
#1  
Senior Member - OP
Thanks Meter 14
Posts: 230
Join Date: Jun 2010
Default [Solved] Market Error "Invalid Package File"

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.
The Following User Says Thank You to sw99 For This Useful Post: [ Click to Expand ]
 
Seandeezy
Old
#2  
Seandeezy's Avatar
Member
Thanks Meter 2
Posts: 73
Join Date: Jan 2011
Location: Anaheim
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?
 
sw99
Old
#3  
Senior Member - OP
Thanks Meter 14
Posts: 230
Join Date: 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.
 
rudey4
Old
#4  
Junior Member
Thanks Meter 0
Posts: 4
Join Date: 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
 
sgt. slaughter
Old
#5  
sgt. slaughter's Avatar
Retired Forum Moderator
Thanks Meter 2865
Posts: 5,577
Join Date: Jun 2010
Location: Raleigh
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.
 
sw99
Old
#6  
Senior Member - OP
Thanks Meter 14
Posts: 230
Join Date: 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.
 
sgt. slaughter
Old
#7  
sgt. slaughter's Avatar
Retired Forum Moderator
Thanks Meter 2865
Posts: 5,577
Join Date: Jun 2010
Location: Raleigh
oughta try reformating your SD card and let the phone reformat it too.
 
sw99
Old
#8  
Senior Member - OP
Thanks Meter 14
Posts: 230
Join Date: Jun 2010
Quote:
Originally Posted by sgt. slaughter View Post
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.
 
sgt. slaughter
Old
#9  
sgt. slaughter's Avatar
Retired Forum Moderator
Thanks Meter 2865
Posts: 5,577
Join Date: Jun 2010
Location: Raleigh
Quote:
Originally Posted by sw99 View Post
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.
 
sw99
Old
#10  
Senior Member - OP
Thanks Meter 14
Posts: 230
Join Date: Jun 2010
Found the problem, updated in OP.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Easily Configure Xposed Module Projects in Eclipse

XDA Recognized Developer rovo89‘s innovative and versatile Xposed Framework allows … more

Android Control Center Becomes Quick Control Panel, Brings Host of New Features

You may recall that back in August of last year, we talked … more

Polish Your Custom Themes with Theme Debugger

Creating a custom Android theme from scratch can be quite the laborious task. In addition to … more

Clean Up Your Logcat Code with Lib Cleaner

Some of you may think that writing code is the hardest part of development. It’s not, as the … more