Bug 5527 - 'Failed to install platform framework' when deploying MFA applications
Summary: 'Failed to install platform framework' when deploying MFA applications
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in ()
Version: unspecified
Hardware: PC Mac OS
: --- blocker
Target Milestone: ---
Assignee: Alan McGovern
Depends on:
Reported: 2012-06-05 17:40 UTC by PJ
Modified: 2012-06-06 05:04 UTC (History)
2 users (show)

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:

Description PJ 2012-06-05 17:40:00 UTC
Not sure exactly what the variables are that cause this to happen, but when it does the steps are simply to create a new MFA app and build and try to deploy it.

The Deploy to Device output error just says "Failed to install package".

Android Tools Log: https://gist.github.com/2877953
Android Tools Log (with export ANDROID_LOG_TASKS): https://gist.github.com/2877971
MD Log: https://gist.github.com/2877985
Logcat: https://gist.github.com/4939b1d22228df97c318

MD 3.0.3 RC1
MFA 4.2.3 RC1

I thought it might have been device or OS specific, but this result: https://testrail.xamarin.com/index.php?/tests/view/175902
throws that theory out unless they used a different device on Snow Leopard than Lion. 

More info from IRC:
   found a way to repro: force-install the MfA 4.2.2 Platform package, and then MD will fail when trying to install the 4.2.3 package: adb uninstall Mono.Android.Platform.ApiLevel_8 ; adb install /Developer/MonoAndroid-v4.2.2/usr/lib/mandroid/platforms/android-8/Mono.Android.Platform.apk
   no stack trace for the 'Failed to install the platform framework' error message from MD
  doubly interesting: `adb shell pm list packages | grep -i mono` includes Mono.Android.Platform.ApiLevel_8, so it _is_ present on device
Comment 1 Jonathan Pryor 2012-06-05 18:07:02 UTC
The variables appear to be "previous Mono platform packages are present." If ALL Mono-related packages are removed, MonoDevelop will quite happily install them and launch the app without error.

To ensure that all Mono-related packages are gone, use:

    adb shell pm list packages | grep -i Mono

You CANNOT use the Manage applications dingus within Android itself; it LIES, and will NOT SHOW packages that `adb shell pm list packages` prints.

To remove a package, use `adb uninstall`

Sample shell session:

$ adb shell pm list packages | grep -i Mono
$ adb uninstall Mono.Android.DebugRuntime
$ adb uninstall Mono.Android.Platform.ApiLl_4 
$ adb uninstall Mono.Android.Platform.ApiLevel_8
$ adb uninstall Mono.Samples.HelloTests
$ adb shell pm list packages | grep -i Mono

However, if I have a Mono for Android v4.2.2 Mono.Android.Platform.ApiLevel_8 package installed, MonoDevelop can't install. For example, if you have a parallel Mono for Android install (don't we all?), you can FORCE a FAILURE with:

> adb install /Developer/MonoAndroid-v4.2.2/usr/lib/mandroid/platforms/android-8/Mono.Android.Platform.apk

Then try to Run an app within MonoDevelop
Comment 2 PJ 2012-06-06 05:04:44 UTC
The fix was to revert a bump of the md-addins hash.

The fix has been verified in MD 3.0.3 RC2 (a1b4e218e1e3455bb97d94a6b5ed68d505e25eeb)