Can't install from market: INSTALL_FAILED_DEXOPT I have an LG Optimus V with CyanogenMod 7.1.  I cannot install/upgrade anything from the Market.  I keep getting "Package File Invalid".  I think it may have something to do with s2e, though I only have apps and download cache moved to SD-ext.

I tried to install an app from the Market, and it gave me "Package File Invalid".  I then ran adb pull downloadfile.apk to get the downloaded apk.  Running adb install downloadfile.apk gave me:

Failure [INSTALL_FAILED_DEXOPT]


How can I fix this, so I can install apps?

EDIT: Could this be due to not having enough space for my new apps' dalvik cache?  I tried to use s2e to copy the dalvik cache to sd-ext, but it's not working.  It says "reboot required", and after I reboot, it still says that; I don't think it copied the files at all.
When I rooted my G1 and was using Cyanogen and we had a similar error we didn't need to reflash the rom, but just the gapps package - try reflashing that. Or other wise on AndroidPolice they have the latest market apk file which you could download and trash flashing that and seeing if that will install over the current market.

If that still doesn't work consider reflashing the ROM and GAPPS package again, but make sure you wipe before flashing. I always found that doing a wipe before each flash made for far fewer issues and errors. 

Case in point is my wife is using my G1 running Cyanogen's 2.2 version of Android and has been up and running for the last 6 months and we haven't had any crashes or errors yet on it, and I made sure to do a wipe and clean install when loading it.