Bug 6091 - HTC One got into a state where it 'Failed to install platform framework' every deploy until all mono packages were deleted
Summary: HTC One got into a state where it 'Failed to install platform framework' ever...
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.2.x
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 5951 ()
Depends on:
Blocks:
 
Reported: 2012-07-12 04:34 UTC by Nischal
Modified: 2012-07-13 17:34 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_ON_ROADMAP

Description Nischal 2012-07-12 04:34:24 UTC
Steps to reproduce this issue:
1. Open API Demo Sample application.
2. Set Target framework to 'Android 4.0.3'
3. Debug the application.

Actual result:
Getting error 'Failed to install the platform framework after debug the application.

Expected result:
Application should deploy to device successfully in debug mode.

Logcat info:
https://gist.github.com/3096709


Environment:
Mac All and Windows All
MD 3.0.3.3
MFA 4.2.4.167234518


Device info:
HTC one
Version 4.0.3

App info:
API Demo/master

Release Vs Debug: This is happening on debug mode only.

Regression status:
REGRESSION: This is not happening with MD 3.0.3.2 and MFA 4.2.3

Note: Checked also on Beta 4.2.4.122434861 and it is not happening on this MFA.
Comment 1 Nischal 2012-07-12 11:51:56 UTC
Tried again after couples of hours by again clearing everything from device and redeploying application on debug mode and it is working fine.
Comment 2 PJ 2012-07-12 15:57:38 UTC
I/PackageManager( 1603): Package Mono.Android.Platform.ApiLevel_8 codePath changed from /data/app/Mono.Android.Platform.ApiLevel_8-1.apk to /data/app/Mono.Android.Platform.ApiLevel_8-2.apk; Retaining data and using new
E/PackageManager( 1603): Package Mono.Android.Platform.ApiLevel_8 signatures do not match the previously installed version; ignoring!
W/PackageManager( 1603): Package couldn't be installed in /data/app/Mono.Android.Platform.ApiLevel_8-2.apk

This seems to be the relevant portion of the logcat. Is this true?


Why is the package is being renamed/relocated as this log snippet indicates?  This might give me clues as to how to reproduce.
Comment 3 PJ 2012-07-12 16:17:21 UTC
To clarify the exact behavior when this issue occurred:


During the time this bug was occurring, were you ever able to successfully debug other applications on any environment?
Comment 4 PJ 2012-07-12 19:56:12 UTC
*** Bug 5951 has been marked as a duplicate of this bug. ***
Comment 5 PJ 2012-07-12 20:00:55 UTC
Bug 5951 had similar behavior, so I compared the gists:

I/PackageManager( 1590): Package Mono.Android.Platform.ApiLevel_15 codePath changed from /data/app/Mono.Android.Platform.ApiLevel_15-1.apk to /data/app/Mono.Android.Platform.ApiLevel_15-2.apk; Retaining data and using new
E/PackageManager( 1590): Package Mono.Android.Platform.ApiLevel_15 signatures do not match the previously installed version; ignoring!
W/PackageManager( 1590): Package couldn't be installed in /data/app/Mono.Android.Platform.ApiLevel_15-2.apk
D/dalvikvm( 1590): GC_EXPLICIT freed 867K, 22% free 12516K/16035K, paused 5ms+10ms
D/AndroidRuntime(10905): Shutting down VM


This output from 5951 matches the output of comment 2. There seems to be some sort of issue where the platform framework is not installed correctly in some case, and then the issue persists until the device is cleaned.

How can we get to the bottom of this?
Comment 6 Jonathan Pryor 2012-07-13 17:30:31 UTC
This looks rather like:

http://docs.xamarin.com/android/troubleshooting#INSTALL_FAILED_UPDATE_INCOMPATIBLE_when_installing_a_package

So what's probably happening is that the Mono.Android.Platform.* and Mono.Android.DebugRuntime packages are signed with different keys between 4.2.3 and 4.2.4.

(This is certainly the case, actually; every time we build, we generate a new Debug signing key for those packages, so they'll never match from one version to the next.)

The proper fix here is to for the package installation process to remove the packages before installing them, instead of blindly installing them to update them. Remove+install happens for me when using xbuild directly on my development machine; perhaps MonoDevelop needs fixing?
Comment 7 Jonathan Pryor 2012-07-13 17:34:53 UTC
mhutch tells me that MonoDevelop/master is getting a completely different code path for package installation, so we should just let this go for now as it should be fixed in MD 3.0.4.