agrinc95 said:
Does anyone frequently get "Package File is Invalid" when installing apps from the Play Store? I've been getting it on each build and avoided it on this current one, but I am getting it not and it is happening more frequently as time goes on. Is there a fix for this?
There is currently no known fix yet but its a problem on all Roms. Just hang tight until then. If you really want an app, just restore your stock nand backup, download the app you want, backup the new app using titanium, and then restore your rom and titanium restore the app. Its a long process but it works.
I spent the better part of the afternoon yesterday trying to figure out the "Package file is invalid." problem since I've been getting it now on Alpha 10 Pre1 and also saw it after a while on Alpha 9. Maybe this is already known, but I've narrowed it down to my /cache partition being too full, specifically the Dalvik cache. I have tried clearing it from recovery so it gets rebuilt and also just using the cleanup feature in Titanium Backup, but neither really helps much because all of the files that are in my Dalvik cache are supposed to be there. I must just have reached the point where I have too many apps installed (I don't know exactly how many I have, but I've installed almost everything I would possibly want to have).
I'm still new to how a lot of this works, but it's my understanding that every app installed on your phone gets an optimized version of some sort put into the Dalvik cache, and that's what your phone actually runs when you open the app. No matter whether you put the app on the SD card or leave it on internal storage, its optimized version goes in the same Dalvik cache folder. It looks to me like on Quattrimus, that folder is actually in the /cache partition, and /data/dalvik-cache is a symlink to it, but I may have that backwards since Solid Explorer doesn't seem to show which is which.
As an example of the error only showing up when there isn't enough space in the /cache partition, yesterday my /cache had about 7 MB free. I could download small apps (presumably less than 7 MB), but when I tried to download a game that was 11 MB, I got the error. I then went and uninstalled a couple apps until my /cache partition had around 16 MB free, and the game installed perfectly.
I don't know enough about Android to say much more, but at least I feel like it's predictable now. The error does seem to only come up when the size of the app roughly exceeds the amount of free space in the cache.
Solution (sort-of):
If you get the "Package file is invalid." error, you probably just need to uninstall some other apps to make more room in the Dalvik cache. You can use an app like
FreeSpace to show you how much space your /cache partition has left, or use a file explorer that can go up to the root directory and then go to the properties of the /cache folder. (I'm using Solid Explorer.) If you really need an app to install that won't, you'll need to uninstall other apps until you see the free space on the /cache partition go up past the size of the app you're trying to install.
From my experience with it the past few days, sideloading does nothing to help because regardless of where the APK came from, there still isn't enough room to install it. Moving apps to the SD card also doesn't help (unless your internal storage shows as nearly full, too) because, from my understanding, apps get an optimized file put into the Dalvik cache no matter where they are stored.
Now, I'm not quite sure why there has to be as much free space in the /cache partition as the size of the app if the file that goes into the Dalvik cache is much smaller than the app itself, and I might be wrong on that, but that's what seems to be the issue here somehow.
Hopefully that helps.
