[Solved] Market Error "Invalid Package File"

Search This thread

sw99

Senior Member
Jun 16, 2010
250
16
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://xdaforums.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.
 
Last edited:
  • Like
Reactions: ohen2494

Seandeezy

Senior Member
Jan 3, 2011
73
2
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

Senior Member
Jun 16, 2010
250
16
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

New member
Jan 18, 2011
4
0
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

Retired Forum Moderator
Jun 12, 2010
5,715
3,088
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

Senior Member
Jun 16, 2010
250
16
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

Retired Forum Moderator
Jun 12, 2010
5,715
3,088
Raleigh
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.
 

dahauss

Senior Member
Jul 20, 2008
1,150
13
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://xdaforums.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.

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??
 
Last edited:

gpz1100

Senior Member
Nov 28, 2009
3,118
608
To the OP,

The program you linked to seems to be a variation of dark tremor's a2sd method (http://xdaforums.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.
 

sw99

Senior Member
Jun 16, 2010
250
16
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
 

sw99

Senior Member
Jun 16, 2010
250
16
To the OP,

The program you linked to seems to be a variation of dark tremor's a2sd method (http://xdaforums.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.

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
 

gpz1100

Senior Member
Nov 28, 2009
3,118
608
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

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.
 

LoVeRice

Senior Member
Mar 14, 2011
827
116
Manila
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*
 

supericexu

New member
May 13, 2011
1
0
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?
 

sw99

Senior Member
Jun 16, 2010
250
16
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?

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.
 

leebo

Senior Member
Apr 4, 2007
547
48
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.
 

dsample

New member
Sep 22, 2011
2
0
UK
sample.me.uk
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+.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    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://xdaforums.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.