Bug 44300 - Xamarin Android Projects are incompatible
Summary: Xamarin Android Projects are incompatible
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General (show other bugs)
Version: 4.2.0 (C8)
Hardware: PC Windows
: Highest critical
Target Milestone: 4.2.1 (C8SR1)
Assignee: Bugzilla
URL:
: 44162 44785 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-14 15:47 UTC by FieldstrikeMobile
Modified: 2016-11-08 09:32 UTC (History)
14 users (show)

Tags:
Is this bug a regression?: Yes
Last known good build: Cycle 7 SR 1


Attachments
XamarinAndroidPackage did not load correctly Log (72.07 KB, text/xml)
2016-09-15 07:58 UTC, Hieu Nhu
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:
VERIFIED FIXED

Description FieldstrikeMobile 2016-09-14 15:47:33 UTC
# Steps to reproduce
Install C8 release using Visual studio and Xamarin Studio updates. Open a Xamarin application now close it and open it again and the Xamarin.Android project is now shown as Incompatible

# Supplemental info (logs, images, videos)
https://ufile.io/47446

# Test environment (full version information)
Visual Studio 2015
Comment 1 FieldstrikeMobile 2016-09-14 15:48:43 UTC
Deleting the contents of:

C:\Users\[User]\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache

and closing and opening Visual Studio makes the android project load. but as soon as you close and open again it is incompatible.

So its only a temporary fix
Comment 2 Daniel Cazzulino 2016-09-14 16:21:07 UTC
Could you please provide the following information:

1 - Help | About VS | Copy Info
2 - Right after the issue happens: Help | Xamarin | Zip Logs...

Please attach both files so we can take a deeper look. Thanks!
Comment 3 FieldstrikeMobile 2016-09-14 16:27:20 UTC
@DanielCazzulino

information uploaded here https://ufile.io/42526

as requested
Comment 5 Hieu Nhu 2016-09-15 07:58:51 UTC
Created attachment 17502 [details]
XamarinAndroidPackage did not load correctly Log

It happened to my Visual Studio also, attached log. Please review & help us resolve the issue. Thank you
Comment 6 FieldstrikeMobile 2016-09-15 10:55:20 UTC
I think this issue has been resolved by Visual Studio 2015 Update 3 patch.

The release notes are outlined here:

https://msdn.microsoft.com/en-us/library/mt752379.aspx

Could have been:

Issue 5
When you upgrade the existing Extension SDK to a later version, the installation fails and you receive the following error message:
The method or operation is not implemented.

or

Issue 12
Visual Studio stamps the output of a PCL-targeting netstandard with a TargetFrameworkAttribute class that may generate MSBuild warnings when that PCL is referenced by other PCLs that target a profile. This warning is now removed by disabling the TargetFrameworkAttribute version check when another PCL references a PCL-targeting netstandard.

I dont know enough about it, but looks to be fixed. be good if someone who knows a bit more about this could confirm?
Comment 8 FieldstrikeMobile 2016-09-15 11:37:45 UTC
@Hieu Nhu, I am also running Update 3 BUT.. a patch was released Yesterday for Update 3.

V14.0.25431.01

In Visual Studio click Help -> about visual studio and check the version number.

I'm guessing it will be a lower version than the one above, if that is the case visit the link and download the updated patch
Comment 9 Hieu Nhu 2016-09-15 11:43:49 UTC
I updated this morning V14.0.25431.01 and I am still having this bug
Comment 10 Hieu Nhu 2016-09-15 14:05:57 UTC
So somehow I resolved (hopefully for good) this via this thread https://bugzilla.xamarin.com/show_bug.cgi?id=44162

I installed MEF Clear Cache Extension into VS and try to clear once. On subsequent run of VS the project seems to load correctly.

Cheers
Comment 11 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-15 16:41:39 UTC
Excellent.  Glad to hear the combination of the latest VS 2015 Update 3 point release along with clearing the MEF component cache has resolved the issue.  I will tentatively mark the bug as an upstream issue in Visual Studio.
Comment 13 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-15 16:52:39 UTC
## Note to the Xamarin Visual Studio team

Do the release notes from the latest VS 2015 Update 3 update (as mentioned in Comment 6) look like they do indeed account for the issue?

(I'll temporarily reopen the bug just to get a quick check on that.  Thanks!)
Comment 14 FieldstrikeMobile 2016-09-21 07:39:17 UTC
@Brendan Zagaeski eventhough I said update 3 fixed it, I don't think it did, its just a bit more intermittent. It would be good to get someone with knowledge of whats going on here to check this out. I'm still using the deleting component cache trick on a daily basis
Comment 15 Jose Gallardo 2016-09-22 16:34:31 UTC
@FieldstrikeMobile,

Can you please try a different workaround?

Please close VS, and delete the following two files from the Xamarin Extension folder:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin\Xamarin\4.2.0.680\Merq.dll

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin\Xamarin\4.2.0.680\Merq.Async.dll


And delete your ComponentModelCache, hopefully for the last time.

Please let us know if this workaround removes the need of deleting the component cache every day in your case.

Thanks!
Comment 16 FieldstrikeMobile 2016-09-23 07:37:00 UTC
@Jose Gallardo, done. I'll let you know how it goes
Comment 17 FieldstrikeMobile 2016-09-23 15:33:57 UTC
@Jose Gallardo, Still getting it I'm affraid. Can't seem to identify a pattern though. May be when I'm building an Android project and I open another solution, but that could be completely wrong
Comment 18 Jose Gallardo 2016-09-23 19:39:52 UTC
@FieldstrikeMobile, I'm sorry to hear that. It looked like a good option.
We'll keep investigating to see if there is anything we can do on our side to prevent this issue.
Thanks for the try!
Comment 19 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-27 16:16:41 UTC
*** Bug 44785 has been marked as a duplicate of this bug. ***
Comment 20 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-27 22:18:07 UTC
## Bookkeeping note

Updating target milestone for tracking the further investigation of this issue.
Comment 21 jcaptanis 2016-09-28 07:48:43 UTC
sigh. what happens when the deleteing cache trick DOESNT work? I have VS2013 and 2015 on my machine, 2015 works, 2013 doesnt after the upgrade from the last cycle stable latest... delete the component cache from every verison of VS i have installed...
Comment 22 NMackay 2016-09-28 08:25:41 UTC
Got the same issue, I have to clear the cache everytime I restart visual studio 2015 (SP3) with Xamarin cycle 8 R0.

Makes it difficult to have multiple solutions opens, along with the mono HTTPS issues which are known and random studio crashes with UWP, it makes the cycle 8 release extremely flaky.
Comment 23 jcaptanis 2016-09-29 00:17:41 UTC
I have uninstalled and reinstalled xamarin, no effect. When i uninstall the iOS project becomes unsupported, and when i reinstall it it works again, but not so for andriod. This is with deleteing the cache at every step of the process!
Comment 24 Alex Eyler 2016-09-29 16:38:57 UTC
Hey all,

One thing that would help us investigate this issue is if you can share the contents of the ComponentModelCache folder before deleting it. There are some logs in there that might help us out, including information about VS being unable to load some MEF component DLLs that could be causing this issue.


Additionally I'd like to know what extensions you have installed - these issues can be caused by a combination of extensions. A screen shot of the Extensions & Updates window should suffice.

Lastly, if you haven't already, please update Visual Studio to the latest version (14.0.25424.00). We released some security/bug fixes that may affect the MEF cache.
Comment 25 NMackay 2016-09-30 10:14:22 UTC
Hi,

My extensions are listed here:

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA687
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015   00322-80000-00000-AA687
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA687
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA687
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA687
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.8.00927.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1   14.1.20907.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.9.5   14.0.20810.0
Azure App Service Tools v2.9.5

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.1.0000.0
Microsoft Azure Data Lake Tools for Visual Studio

Clang with Microsoft CodeGen   14.0.25516
Clang with Microsoft CodeGen

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JetBrains ReSharper Ultimate 2015.2   Build 103.0.20150818.200216
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

LLBLGen Pro Designer   4.0
The LLBLGen Pro designer integrated inside Visual Studio.

Microsoft .NET Core Tools (Preview 2)   14.1.20907.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Hive Query Language Service   2.1.0000.0
Language service for Hive query

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.9.40715.2

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

NuGet Package Manager   3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

OptionsPackage Extension   1.0
OptionsPackage Visual Studio Extension Detailed Info

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60812.0
Microsoft SQL Server Data Tools

Telerik WPF VSExtensions   2016.3.909.0
Telerik UI for WPF VSExtensions

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

UWPTileGeneratorCommand Extension   1.0
UWPTileGeneratorCommand Visual Studio Extension Detailed Info

Visual C++ for Cross Platform Mobile Development (Android)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (iOS)

Visual Studio Tools for Apache Cordova   Update 10
Visual Studio Tools for Apache Cordova

Visual Studio Tools for Universal Windows Apps   14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.2.0.695 (7603786)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.1.2 (c1d1c79)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.0.0.1 (29910bb)
Visual Studio extension to enable development for Xamarin.iOS.

And the component cache info can be found here:

https://drive.google.com/drive/folders/0B90tKD37uOtwV1FIZmR4ZjFNbTg?usp=sharing

Hope this is of some help.
Comment 26 Daniel Cazzulino 2016-09-30 13:48:44 UTC
Hi there!
 
I've put together a build on top of current stable (4.2.0.695) that should fix this issue: http://xvs.xamarin.com/patcheddrops/Xamarin.VisualStudio_4.2.0.698.msi

It will also be included in all future releases.

Please do reopen if you see this happen again in the future.

Thanks for reporting the issue!
Comment 27 NMackay 2016-09-30 14:05:31 UTC
Hi,

I tried this version, installed and it rebuild the MEF cache on 1st run, 1st solution loaded ok, open another instance of studio and load another solution and it throws the same error again.

This was recorded in the Visual Studio activity log.

723 ERROR LegacySitePackage failed for package [XamarinAndroidPackage]Source: 'Xamarin.AndroidTools' Description: Method not found: 'Void Mono.AndroidTools.AnalyticsService.ReportContextProperty(System.String[], System.String[])'. System.MissingMethodException: Method not found: 'Void Mono.AndroidTools.AnalyticsService.ReportContextProperty(System.String[], System.String[])'. at Xamarin.AndroidTools.MonoDroidSdk.Refresh(String runtimePath, String binPath, String bclPath) at Xamarin.AndroidTools.MonoDroidSdk.GetSdk() at Xamarin.AndroidTools.AndroidSdk.<>c.<GetInstalledPlatformVersions>b__66_1(AndroidVersion version) at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x) at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext() at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source) at Xamarin.VisualStudio.Android.Services.AndroidToolsSdk.CheckInstalledPlatformVersions() in C:\data\lanes\3879\016ed177\source\xamarinvs\src\Core\VisualStudio.Android\Services\AndroidToolsSdk.cs:line 374 at Xamarin.VisualStudio.Android.Services.AndroidToolsSdk.CheckAndroidSdkSettings() in C:\data\lanes\3879\016ed177\source\xamarinvs\src\Core\VisualStudio.Android\Services\AndroidToolsSdk.cs:line 367 at Xamarin.VisualStudio.Android.Services.AndroidToolsSdk.Start() in C:\data\lanes\3879\016ed177\source\xamarinvs\src\Core\VisualStudio.Android\Services\AndroidToolsSdk.cs:line 311 at Xamarin.VisualStudio.Android.XamarinAndroidPackage.Initialize() in C:\data\lanes\3879\016ed177\source\xamarinvs\src\Core\VisualStudio.Android\XamarinAndroidPackage.cs:line 134 at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp) {296E6A4E-2BD5-44B7-A96D-8EE3D9CDA2F6} 80131513 VisualStudio 2016/09/30 14:00:33.706 
724 ERROR SetSite failed for package [XamarinAndroidPackage](null) {296E6A4E-2BD5-44B7-A96D-8EE3D9CDA2F6} 80131513 VisualStudio 2016/09/30 14:00:33.722 
725 ERROR End package load [XamarinAndroidPackage] {296E6A4E-2BD5-44B7-A96D-8EE3D9CDA2F6} 80131513 VisualStudio 2016/09/30 14:00:33.725
Comment 28 Daniel Cazzulino 2016-10-03 14:33:49 UTC
Reopening based on the latest comment.

@NMackay I'd like to follow up 1:1. Please ping on Skype, I'm danielkzu.

Thanks!
Comment 29 NMackay 2016-10-03 14:51:56 UTC
Hi Daniel,

I've sent an invite (Scaramanga...an old halflife gamer tag, I should update my Skype).

I reinstalled the update and rebooted and I can't recreate it. I have to add I disabled the testcloud recorder extension after @VictorGarciaAprea suggested that to stop the UWP VS crashes I'm having but either way, it's working fine now, sometimes VS says teh Android solution has been modified outside the environment (one 1st load only) and it reload fines and seems fine after that so perhaps the testrecorder pluggin was causing an issue.

Let me know if you want any more information but it is working okay now.

Thanks.
Comment 30 Daniel Cazzulino 2016-10-03 15:21:59 UTC
That's great news Norman!

We'll follow up with the TestRecorder team to see if we can fix this on their side.

Resolving this as fixed then. Phiu!
Comment 31 James 2016-10-03 22:50:17 UTC
Microsoft Visual Studio Enterprise 2015
Version 14.0.25425.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Xamarin   4.2.0.698 (016ed17)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.1.2 (c1d1c79)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.0.0.1 (29910bb)
Visual Studio extension to enable development for Xamarin.iOS.

I am unfortunately still running into this issue pretty consistently on my machine, and I have the build in question installed.
Comment 32 jcaptanis 2016-10-03 23:51:33 UTC
@Daniel Cazzulino

That build has fixed up my issue. thanks heaps!!
Comment 33 James 2016-10-03 23:52:28 UTC
It looks like uninstalling the Test Recorder gets things working once more. I missed that step previously.
Comment 34 Daniel Cazzulino 2016-10-04 13:23:57 UTC
We'll follow-up with the test recorder guys.

Thanks everyone!
Comment 35 Brendan Zagaeski (Xamarin Team, assistant) 2016-10-06 15:18:02 UTC
*** Bug 44162 has been marked as a duplicate of this bug. ***
Comment 36 xamarin-release-manager 2016-10-06 22:39:36 UTC
Fixed in version 4.2.0.743 (cycle8)

Author: Jose Gallardo
Commit: 87bfae03bc2b68d0ccd17eeaa7f7d0d64325b57d (xamarin/XamarinVS)
Comment 37 Mohit Kheterpal 2016-11-02 19:10:40 UTC
As per above comments, this issue is fixed for end users, hence closing this issue by marking it as Verified.

thanks