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+.
Hi, i am currently using Kyrillos Rom V 7.0 Non OC.
Yesterday,my phone battery drained to the end (not a problem until here).
When i arrived home i turned it on after charging for a while,but them,all my apps were gone. I can still see them at the Aplications Manager,but i cant "move to phone" (the box is hidden).
I got my SD card formated using a swap and a Ext4 partition so i can use Apps2SD+ and it was working fine for like 1 Month.
Also, my Market can't install any app anymore,since it shows "File Package is not Valid" message.
What i've tried :
1 - Setting / Storage / unmount - > mount Sd Card
2 - Recovery Mode -> Mount and Storage -> Mount Ext , Mount Sdcard , rebooted.
Nothing Worked,
I hope someone can help me.
Thanks.
try wiping cache and dalvik cache
RafayelG said:
try wiping cache and dalvik cache
Click to expand...
Click to collapse
Will this Wipe all my apps on Sd ?
I dont want to wipe my Sd card data by any means : (
Since i cant backup it using Titaniun Backup because i can't install it from market,i dont want to wipe my SD.
What exactly this "Wipe Cache and Dalvik Cache" does ?
EDIT : Ok, Seems it doesn't destroy any piece of user data.
Wipping it now,and will be back to tell what happened
Didn't worked.
Any other help ?
This same thing happened to one of my very good friends Jinxskore. He then had to wipe data, cache and dalvik. All three. Then it was normal again. Your data will be lost I am afraid.
dhirend_6d said:
This same thing happened to one of my very good friends Jinxskore. He then had to wipe data, cache and dalvik. All three. Then it was normal again. Your data will be lost I am afraid.
Click to expand...
Click to collapse
Fack.
Well,i am still looking for a non hardcore solution,hope i find it .
Thanks anyway.
Anyone else ?
I'm starting to lose my faith : (
Try to use Titanium Backup, install it from your pc!
I have the same thing every time I boot up. After my media scanner is finished it just doesn't show my apps. Only sometimes when I wait very long it shows them. So I try to keep my phone on as long as I can. But I can't install apps from the market either. I touch for example 'free' press accept and it just doesn't start downloading anything! But a reboot fixes the install problem most of the time for a while...
Btw what kinda sd card are you using? I have a 16gb class 2.
So I blame my problems to that.
I have an idea
Hey about Contacts and SMS backup use relavant apps. Contacts can be backed up on Sd card and copied to pc, I dont think sms backup needed you can let them go if they are important PM me to tell you a method. I hope you have root explorer. If no download it from a PC file sharing website and simply install it. Go to /-->data-->app Copy all apks of your installed apps to sd.
Now you wont lose your apps. Backup SD. I would recommend to use *2676*3855# and Hard Reset/ Factory Format your phone. Format SD after complete backup and re partition do all again, set up phone enjoy it again.
alright. i am new here btw. i dont know if someone has already posted this kind of problem on SGY. some were kinda too savvy when i try to relate my problem on other threads.
here it goes:
few months before, i rooted my SGY phone from gingerbread to jelly blast and i successfully did it well. then, i had partitioned my SGY's 8GB MMC. i successfully partitioned my mmc and got extra 1GB for internal memory so that i can install more apps. i had also managed to transfer apps with huge amount of datas to the 2nd partition - to free up space on the real internal memory. everything was perfect until...
i got my phone wet by accident - but not internally and it would not start no matter what. got it repaired by a tech, found out that the power amp was grounded. made some sortings and it was working again.
little did i know that there was a collateral damage - all settings has been reset. i lost my apps, my contacts, messages, and anything saved on the phone. but it's still rooted and runs jelly blast. the problem is that since i made a 2nd partition of my mmc, i cant get them back up again. when i try to go to link2sd>storage info>SD card 2nd Part. and it still shows used 312MB so the apps are possibly in it.
can someone please help me on how to get them back or restored? any advice would be very much appreciated. thanks. :angel:
tried to go on google play but wasn't of help.
I don't think so it is possible to restore from 2nd partition
But I have an idea don't know work or not
go to data folder by using root explorer or anything else
Then search for sd-ext or sd-ext2 and look, there is any apps present or not
If not then open link2sd and clear 2nd partition your memory will be free
press thanks if i help you
sent from my ANDROID using
XDA PREMIUM
Another idea:
Boot a Live Linux from your PC and mount your sd card, then c&p your content to another partition.
Did this on my old Smartphone with 2 Partitions fat32+ext4
Hope that helps
Sachin Patel said:
I don't think so it is possible to restore from 2nd partition
But I have an idea don't know work or not
go to data folder by using root explorer or anything else
Then search for sd-ext or sd-ext2 and look, there is any apps present or not
If not then open link2sd and clear 2nd partition your memory will be free
press thanks if i help you
sent from my ANDROID using
XDA PREMIUM
Click to expand...
Click to collapse
Ey, thanks! I went to my File Explorer>Settings>Root Explorer. I found "data" folder > sdext2 and when i opened it - i saw all the apps i have installed and moved to the 2nd partition! hooray for that!!
i tried to test by clicking on one app, it then opened asking me to use package installer or app system installer. i ran package installer, got warning about installing unknown resources (though the apps came from google play).. so i enabled unknown resources. installed it. :fingers-crossed:
it worked - the app got restored!!! :laugh: is this the right thing to do or was there anything that should be done first? :highfive:
and other questions:
a. link2sd asked me what should be mounted on sd card. i remember from the time i began to partition - i chose ext3. but now on the sd card, when i got the data folder, it shows all my apps on sdext2 folder. which one should i mount? EXT2 or EXT3?
b. due to all this incident, whenever i turn my phone on - it keeps on telling me that the com.android.phone has stopped unexpectedly. how do i fix this? PS i remember while searching on data folder where i got sdext2, i found another data folder. it shows there com.android.phone but i dont know how to configure this.
tonytiny16 said:
Ey, thanks! I went to my File Explorer>Settings>Root Explorer. I found "data" folder > sdext2 and when i opened it - i saw all the apps i have installed and moved to the 2nd partition! hooray for that!!
i tried to test by clicking on one app, it then opened asking me to use package installer or app system installer. i ran package installer, got warning about installing unknown resources (though the apps came from google play).. so i enabled unknown resources. installed it. :fingers-crossed:
it worked - the app got restored!!! :laugh: is this the right thing to do or was there anything that should be done first? :highfive:
and other questions:
a. link2sd asked me what should be mounted on sd card. i remember from the time i began to partition - i chose ext3. but now on the sd card, when i got the data folder, it shows all my apps on sdext2 folder. which one should i mount? EXT2 or EXT3?
b. due to all this incident, whenever i turn my phone on - it keeps on telling me that the com.android.phone has stopped unexpectedly. how do i fix this? PS i remember while searching on data folder where i got sdext2, i found another data folder. it shows there com.android.phone but i dont know how to configure this.
Click to expand...
Click to collapse
A. You should choose that one by which you partition your memory card, ext2 or ext3
B. For fix this problem go to cwm mod and select advanced and select fix permission
press thanks if i help you
sent from my ANDROID using
XDA PREMIUM
Sachin Patel said:
B. For fix this problem go to cwm mod and select advanced and select fix permission
Click to expand...
Click to collapse
i tried that successfully but unfortunately, it didnt work. i got additional error message: the process com.android.mms has stopped unexpectedly.
what could have been wrong?
i tried to copy the folder com.android.phone and com.android.mms from the system root to the sd card android folder but things are still the same. issue persists..
Hi
One of my voluntary roles now requires me to keep any local cache of email encrypted.
They advise using Full Disk Encryption.
I do a lot of work on my phone. I also want my phone to be rooted, for various apps.
It seems it is not easy to use the Android standard encryption system. All encryption attempts fail when rooted.
I have tried factory resetting everything and installing stock ROM, encryption then works fine. If I factory reset everything, install stock ROM and root it, encryption then doesn't work at all. I just get what looks like a boot-loop for some considerable time, then reboot into standard unencrypted Android.
Old posts on here suggest using adb to get root permissions and kill the superuser daemon then immediately start encryption. I tried this and it didn't work.
This post suggests converting SuperSU to a system app and disabling that app in Application Manager, then rebooting in safe mode and encrypting the phone. But I can't find the option in SuperSU to install it as a system app. I am attempting to convert it to a system app using Titanium Backup but this hangs - perhaps unsurprising as Titanium Backup uses superuser privileges.
I can't find any other advice as to how encrypt whilst rooted.
The alternative would be to find a mail client that encrypts data including its cache on the fly. I have one for Windows (The Bat) but I don't think there is one for Android? All searches just suggest K-9 and APG, which is great for sending encrypted mail but not for encrypting the app's data storage itself.
I am using stock UK 5.1.1 Samsung ROM N910FXXS1CPC1_N910FBTU1COI1_N910FXXS1COK1. But I don't have to use that version of Android, or stock, if alternatives can enable me to have Root and either full disk encryption or encrypted Email storage.
Really would appreciate any suggestions or assistance anybody could bring - thank you!
kingqueen said:
Hi
One of my voluntary roles now requires me to keep any local cache of email encrypted.
They advise using Full Disk Encryption.
I do a lot of work on my phone. I also want my phone to be rooted, for various apps.
It seems it is not easy to use the Android standard encryption system. All encryption attempts fail when rooted.
I have tried factory resetting everything and installing stock ROM, encryption then works fine. If I factory reset everything, install stock ROM and root it, encryption then doesn't work at all. I just get what looks like a boot-loop for some considerable time, then reboot into standard unencrypted Android.
Old posts on here suggest using adb to get root permissions and kill the superuser daemon then immediately start encryption. I tried this and it didn't work.
This post suggests converting SuperSU to a system app and disabling that app in Application Manager, then rebooting in safe mode and encrypting the phone. But I can't find the option in SuperSU to install it as a system app. I am attempting to convert it to a system app using Titanium Backup but this hangs - perhaps unsurprising as Titanium Backup uses superuser privileges.
I can't find any other advice as to how encrypt whilst rooted.
The alternative would be to find a mail client that encrypts data including its cache on the fly. I have one for Windows (The Bat) but I don't think there is one for Android? All searches just suggest K-9 and APG, which is great for sending encrypted mail but not for encrypting the app's data storage itself.
I am using stock UK 5.1.1 Samsung ROM N910FXXS1CPC1_N910FBTU1COI1_N910FXXS1COK1. But I don't have to use that version of Android, or stock, if alternatives can enable me to have Root and either full disk encryption or encrypted Email storage.
Really would appreciate any suggestions or assistance anybody could bring - thank you!
Click to expand...
Click to collapse
Hmm. Maybe I have found a way round it.
I have an external SD card installed. I have selected "Encrypt external SD card" (new files only and "Exclude multimedia files") then [email protected] allows me to select for the relevant mail account: "Storage location External storage (SD card)"
Hopefully, therefore, the file storage for that mail account is now stored encrypted on the external SD card, without me having had to encrypt the whole device...
kingqueen said:
Hmm. Maybe I have found a way round it.
I have an external SD card installed. I have selected "Encrypt external SD card" (new files only and "Exclude multimedia files") then [email protected] allows me to select for the relevant mail account: "Storage location External storage (SD card)"
Hopefully, therefore, the file storage for that mail account is now stored encrypted on the external SD card, without me having had to encrypt the whole device...
Click to expand...
Click to collapse
You can install Super SU as a system app. It's an option In SU prefs...
pr1jker said:
You can install Super SU as a system app. It's an option In SU prefs...
Click to expand...
Click to collapse
For me, the option tells me "Not (currently) available in system-less root mode"
I would like an answer to this too.. One of my two issues with my Note 4