“I always say, 'This will be my last 'Metal Gear.'” Hideo Kojima

HOWTO avoid INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION

Here I come with another quick post about how to avoid an unexpected error I found while testing apps on my phone.

I found an error message with the following information:

Failure INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION

When I was about to give up, I found a helpful post on Google Groups that mentioned the use of strings references on AndroidManifest.xml. Then, I remembered changing my code so it used this kind of references (as you can see on this github commit) for the sake of simplicity.

So, open your AndroidManifest.xml and if you have something like this inside your tag:

	...
	android:versionCode="@string/app_versionCode"
	...

then you will need to remove the string reference and use a number directly.

	...
	android:versionCode="6"
	...

As explained in Google Groups post, Android is not able to transform string references for versionCode. It’s important to note that you can use string references for versionName (I guess because it’s a string, and not an integer…but i’m not sure).

So, change your versionCode field and enjoy!

Happy coding! See you :)

Jordi.

See also: