**UPDATE (4/20/2009) – a Google employee has commented on the open bug report and says this will be fixed in a future software release. Whether this makes it into the impending Cupcake update is anyone’s guess, though.**
Today we released the 1.1 update to RockOut Acoustic Pro. This update adds some neat new features like “Fretting Mode,” which lets you hold the screen to “fret” chords and strum using the trackball. We thoroughly tested the application for both new installs and updates from the old version, on both the Android emulator and an actual G1. Everything looked good.
But when we actually put the update on the Market, some users complained the app was automatically force closing (read: crashing) when they installed the update.
I couldn’t reproduce it, but then a user sent me his log files (thanks to the wonderful Log Collector app). Here’s some relevant parts, and then the explanation:
E/PackageManager( 51): Package com.activefrequency.android.rockoutacousticpro has mismatched uid: 10046 on disk, 10047 in settings; read messages:
...
E/Database( 228): sqlite3_open_v2("/data/data/com.activefrequency.android.rockoutacousticpro/databases/song_list.db", &handle, 6, NULL) failed
...
Here’s why this happened: When we first released RockOut Acoustic Pro we had copy protection turned on. I turned it off a day or two later because an odd Market bug that Google won’t really acknowledge causes copy protected apps not to show at all on the market on many phones (normal G1s, not just ADPs).
This only happened, as far as I can tell, to users who previously had the copy protected version of my app installed.
The copy protection mechanism changes the uid of the application, so that non-copy-protected versions of the same app signed by the same key are no longer recognized as the same application, and are denied access to the database and other resources for the application.
This is never documented anywhere in any official Market or Android documentation, as far as I can see.
Plus, we had no way to figure this out on our own because developers can never install their own paid apps off the market, therefore can never test the copy-protected versions of their apps!
Now that I actually know the root cause of the problem, it’s easy enough to google and I can see I’m not the first dev burned by it.
There’s a ticket to fix this but no progress that I can see. This means Google is aware of the problem, yet doesn’t tell you about it when they know you’re about to break updates for your app by checking or unchecking the copy protection box. This is a 100% predictable result, and should be simple to warn developers about before they hurt their reputation or suddenly get dozens of negative reviews.
The absolute bare minimum Google can do is DOCUMENT this. I can’t see it taking more than 10 minutes to add a warning box when you add or remove copy protection from an app already live on the market, and it would have saved me a good hour of frantic hunting for a bug in my code that wasn’t there.
Is just disclosing this to developers too much to ask?