Update: The latest update for CyanogenMod for Milestone – version 220.127.116.11 solves this problem as well.
Lately I’ve been having problems updating software on my Motorola Milestone (1, as in A853) running CyanogenMod 7.1 (thanks to Nadalbak who maintains an unofficial and unsupported port of CyanogenMod for this old device). When I start the Android Market and do an update of an existing application, I get the error “Package file is invalid” for any application. Sometimes removing an application and reinstalling it will work, but often not.
There could be several problems that cause this, apparently a problem with the file permissions on the file systems is common, and if this is your problem then it can be fixed by opening the terminal emulator, executing “su” to gain super-user permissions and then running “fix_permissions” (it will take a while to complete).
If this doesn’t solve the problem for you, then likely the problem is that you ran out of space on your “data” partition or “cache” partition. This is very common if you have a large “apps partition” on your SD card and you are in the habit of installing tons of applications – I know I am 🙂 .
The problem is the “Dalvik cache” that gets full and apparently the operating system doesn’t clear old files from it so it will eventually run out of space.
I’ve tried cleaning the Dalvik cache, using Titanium backup and the OpenRecovery menu – but that doesn’t clean the cache properly for some reason, likely because it expects the cache to be on the “data” partition but in CyanogenMod 7 for Milestone the Dalvik cache is on the “cache” partition.
To solve the problem, boot into OpenRecovery(1) then select “Wipe cache” from the main menu. Please note that you must wipe the entire cache partition and not just the Dalvik cache. Also make sure not to choose the similar option to wipe the data partition as that will remove all your personal data from the phone…
If your /cache partition is constantly overloaded in your Mileston A853 running CyanogenMode 7.1, you can disable the hosting of the apps dalvik cache under /cache by editing the system’s build.prop file. To do it follow these instructions.
- Start a terminal in your phone using the terminal emulator app (or an alternative – I use ConnectBot).
suand approve the super user mode.
mount /system -o remount,rwto allow editing the build.prop file.
vi /system/build.propto edit the file.
- Find the instruction
dalvik.vm.dexopt-cache-only– you can type
/dalvik<ENTER>to find it. Move the cursor to the end of the line and press on “A” to start editing. Delete the “1” at the end of the that line and write “0” instead.
- Issue an “ESC” button (in ConnectBot you can do it by pressing the camera shutter button) and then type “:x” to save the changes and leave the editor.
mount /system -o remount,roto return the system files to read only mode.
- Reboot to OpenRecovery and use it to clear the dalvik cache and the cache partition, and then reboot the phone.
Your device should now have enough space in the /cache partition.
- CyanogenMod 7.1 Released (beast4romtheeast.wordpress.com)
- Netflix for Android Officially Recognizes CyanogenMod ROMs (pocketnow.com)
- When you hold the power button and select “Reboot” from the popup menu, CyanogenMod will ask you if you want to do a normal reboot or to boot to recovery, so it is very easy to get to. Otherwise you can turn off the phone and then hold the “x” button on the hardware keyboard while turning on the phone [↩]