Bug 60199 - Xamarin.Android troubles following install of Xamarin 4.7 on Visual Studio 2015
Summary: Xamarin.Android troubles following install of Xamarin 4.7 on Visual Studio 2015
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.7.0 (15.4)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-16 10:28 UTC by Alexander Melchers
Modified: 2017-11-08 00:48 UTC (History)
7 users (show)

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


Attachments
The activity-log referred to in the original warning dialog. (71.23 KB, text/xml)
2017-10-16 10:29 UTC, Alexander Melchers
Details


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 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 FIXED

Description Alexander Melchers 2017-10-16 10:28:12 UTC
Hi all,

I'm running into trouble with my Xamarin.Android installation after having upgraded my Xamarin version to 4.7 on Visual Studio 2015 (Update 3), Windows 10. What happens initially, it that Visual Studio starts up fine, though a little slower than normal, following which I receive a pop-up with a warning message as follows:

The 'XamarinAndroidPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\MyWinId\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.

Checking the activity log gets me the below as the most likely culprit:

LegacySitePackage failed for package [XamarinAndroidPackage]
Source: 'System.ComponentModel.Composition'
Description: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information. 1) Object reference not set to an instance of an object.
Resulting in: An exception occurred while trying to create an instance of type 'Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider'.
Resulting in: Cannot activate part 'Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider'.
Element: Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider --> Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider --> ComponentCatalog (Types='Clide.ErrorsManager, Clide.HostImpl, ...').
Resulting in: Cannot get export 'Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider (ContractName="Xamarin.VisualStudio.Android.IAndroidVirtualDeviceProvider")' from part 'Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider'.
Element: Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider (ContractName="Xamarin.VisualStudio.Android.IAndroidVirtualDeviceProvider") --> Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider --> ComponentCatalog (Types='Clide.ErrorsManager, Clide.HostImpl, ...').
Resulting in: Cannot set import 'Xamarin.VisualStudio.Android.MonoAndroidDeviceProvider..ctor (Parameter="virtualDeviceProviders", ContractName="Xamarin.VisualStudio.Android.IAndroidVirtualDeviceProvider")' on part 'Xamarin.VisualStudio.Android.MonoAndroidDeviceProvider'.
Element: Xamarin.VisualStudio.Android.MonoAndroidDeviceProvider..ctor (Parameter="virtualDeviceProviders", ContractName="Xamarin.VisualStudio.Android.IAndroidVirtualDeviceProvider") --> Xamarin.VisualStudio.Android.MonoAndroidDeviceProvider --> ComponentCatalog (Types='Clide.ErrorsManager, Clide.HostImpl, ...').
Resulting in: Cannot get export 'Xamarin.VisualStudio.Android.MonoAndroidDeviceProvider (ContractName="Xamarin.VisualStudio.Android.IMonoAndroidDeviceProvider")' from part 'Xamarin.VisualStudio.Android.MonoAndroidDeviceProvider'.
Element: Xamarin.VisualStudio.Android.MonoAndroidDeviceProvider (ContractName="Xamarin.VisualStudio.Android.IMonoAndroidDeviceProvider") --> Xamarin.VisualStudio.Android.MonoAndroidDeviceProvider --> ComponentCatalog (Types='Clide.ErrorsManager, Clide.HostImpl, ...').
Resulting in: Cannot set import 'Xamarin.VisualStudio.Android.MonoAndroidDeviceManager..ctor (Parameter="deviceProvider", ContractName="Xamarin.VisualStudio.Android.IMonoAndroidDeviceProvider")' on part 'Xamarin.VisualStudio.Android.MonoAndroidDeviceManager'.
Element: Xamarin.VisualStudio.Android.MonoAndroidDeviceManager..ctor (Parameter="deviceProvider", ContractName="Xamarin.VisualStudio.Android.IMonoAndroidDeviceProvider") --> Xamarin.VisualStudio.Android.MonoAndroidDeviceManager --> ComponentCatalog (Types='Clide.ErrorsManager, Clide.HostImpl, ...').
Resulting in: Cannot get export 'Xamarin.VisualStudio.Android.MonoAndroidDeviceManager (ContractName="Xamarin.VisualStudio.Android.IMonoAndroidDeviceManager")' from part 'Xamarin.VisualStudio.Android.MonoAndroidDeviceManager'.
Element: Xamarin.VisualStudio.Android.MonoAndroidDeviceManager (ContractName="Xamarin.VisualStudio.Android.IMonoAndroidDeviceManager") --> Xamarin.VisualStudio.Android.MonoAndroidDeviceManager --> ComponentCatalog (Types='Clide.ErrorsManager, Clide.HostImpl, ...').
Resulting in: Cannot set import 'Xamarin.VisualStudio.Android.Commands.ShowDeviceLogging..ctor (Parameter="deviceManager", ContractName="Xamarin.VisualStudio.Android.IMonoAndroidDeviceManager")' on part 'Xamarin.VisualStudio.Android.Commands.ShowDeviceLogging'.
Element: Xamarin.VisualStudio.Android.Commands.ShowDeviceLogging..ctor (Parameter="deviceManager", ContractName="Xamarin.VisualStudio.Android.IMonoAndroidDeviceManager") --> Xamarin.VisualStudio.Android.Commands.ShowDeviceLogging --> ComponentCatalog (Types='Clide.ErrorsManager, Clide.HostImpl, ...').
Resulting in: Cannot get export 'Xamarin.VisualStudio.Android.Commands.ShowDeviceLogging (ContractName="Clide.Commands.ICommandExtension")' from part 'Xamarin.VisualStudio.Android.Commands.ShowDeviceLogging'.
Element: Xamarin.VisualStudio.Android.Commands.ShowDeviceLogging (ContractName="Clide.Commands.ICommandExtension") --> Xamarin.VisualStudio.Android.Commands.ShowDeviceLogging --> ComponentCatalog (Types='Clide.ErrorsManager, Clide.HostImpl, ...').


This being the case, I've since turned off the Live Player from the Xamarin-settings under Tools->Options, which seems to have resolved the warning message. However, the next issue I got was an error stating that

Xamarin.Android for Visual Studio requires Android SDK. Please install it or set Android SDK path on Tools->Options->Xamarin->Android Settings menu.

Multiple versions of the SDK are installed on my system, and the paths to the SDKs is correctly configured in the above settings menu. Interestingly, the error no longer appears after restarting Visual Studio, but now Visual Studio no longer recognizes my real Samsung Galaxy S5, which I use for debugging purposes (as an aside, I also seem to have difficulties loading iOS-projects too).

The project I'm trying this with is an existing Xamarin.Forms project.

I would like to be able to upgrade my Xamarin to version 4.7, as this allows me to set the Android target framework to Android 8.

Any help would be greatly appreciated.
Comment 1 Alexander Melchers 2017-10-16 10:29:29 UTC
Created attachment 25310 [details]
The activity-log referred to in the original warning dialog.
Comment 2 Alexander Melchers 2017-10-16 11:19:47 UTC
I should specify that the version of Xamarin updated to is 4.7.10, while 4.7.9 still works fine.
Comment 3 Jon Douglas [MSFT] 2017-10-16 15:26:26 UTC
Moving to Visual Studio Extensions for Visibility
Comment 4 Alexander Melchers 2017-10-16 16:35:26 UTC
So, the fact that my Samsung test device did not turn up in Visual Studio as a target device might have had to do with some HTC development/USB drivers that I had de-installed before, as the problem also occurred following a downgrade to the last-known-good version of Xamarin (4.7.9), but subsequently disappeared following a reboot. Because of this, I retried installing Xamarin 4.7.10, but never get far enough to actually test whether I could debug an Android application, as loading the solution freezes Visual Studio. With this respect it might be interesting to note that I'm using Resharper as an extension.
Comment 5 Jimmy [MSFT] 2017-10-16 20:43:32 UTC
Hey Alexander,
Your most recent issue where VS is freezing is being tracked as bug #60080
The current workaround is to delete the .vs folder in your project directory. 

Let us know if you are still experiencing your original issues after reinstalling 4.7.10. Thanks!
Comment 6 Alexander Melchers 2017-10-17 10:29:49 UTC
Hi Jimmy,

Thanks for the suggestion. Deleting the .vs-folder does indeed seem to fix the issue of VS freezing while opening the solution. Unfortunately, however, it turns out I need to delete this folder each and every time I need to open the solution. And with multiple solutions (main project and various R&D side projects) and multiple branches therein to open on a daily basis - if not multiple times a day - deleting the .vs-folder is not only cumbersome, but also risk prone (don't delete your .git-folder accidentally!). Moreover, it feels like the project-files are being loaded less rapidly than with Xamarin 4.7.9, AND I've since experienced VS turning black as though experiencing memory issues. This was with two instances of VS open - one with a smaller project and one with our main project (normally not an issue) - with the smaller project in the act of being built on a Mac build agent.

Even though with the work-around it seems possible to work with the new version of Xamarin, I have since decided to revert back to my previous version of Xamarin until a more stable version or more workable solution comes around...
Comment 7 Pierce Boggan [MSFT] 2017-11-03 04:09:49 UTC
Moving back to NEW as information was provided.
Comment 8 Alexander Melchers 2017-11-08 00:48:24 UTC
The problems described above seem to have been resolved with the most recent release of Xamarin, version 4.7.10.33. I'm marking this call as resolved.