Bug 23829 - Xamarin.Android 4.99 The "ResolveSdks" task failed unexpectedly - References dll not found
Summary: Xamarin.Android 4.99 The "ResolveSdks" task failed unexpectedly - References ...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.18.0
Hardware: PC Windows
: High normal
Target Milestone: 5.0
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-10-14 23:50 UTC by Horácio J. C. Filho
Modified: 2014-11-28 09:26 UTC (History)
7 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:
VERIFIED FIXED

Description Horácio J. C. Filho 2014-10-14 23:50:01 UTC
Hi guys, I was excited to play with Xamarin.Android 4.99 from alpha channel, but I've run on this error:

Warning	2	The "ResolveSdks" task failed unexpectedly.
System.MissingMethodException: Method not found: 'System.String Xamarin.AndroidTools.MonoDroidSdk.GetApiLevelForFrameworkVersion(System.String)'.
   at Xamarin.Android.Tasks.ResolveSdks.ValidateApiLevels()
   at Xamarin.Android.Tasks.ResolveSdks.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()	Galilei

Is impossible build any Xamarin.Android solution (Xamarin.Android app, Xamarin.Android library, Xamarin.Android binding), it fail to find Mono.Android.dll, System.dll, System.Core.dll and any other related in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\ folder, even if they are there, I think this problem is due the new $(TargetFrameworkVersion) scheme. 

- 
System info:
Android SDK Tools 23.0.5
Android SDK Platform-tools 20
Android SDK Build-tools 20

Microsoft Visual Studio Ultimate 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Ultimate

Architecture and Modeling Tools   06181-004-0449004-02359
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.

Team Explorer for Visual Studio 2013   06181-004-0449004-02359
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06181-004-0449004-02359
Microsoft Visual Basic 2013

Visual C# 2013   06181-004-0449004-02359
Microsoft Visual C# 2013

Visual C++ 2013   06181-004-0449004-02359
Microsoft Visual C++ 2013

Visual F# 2013   06181-004-0449004-02359
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06181-004-0449004-02359
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.3.50717.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

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

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

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

Microsoft Azure Mobile Services Tools   1.2
Microsoft Azure Mobile Services Tools

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

PowerShell Tools   1.2
Provides file classification services using PowerShell

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

SQL Server Data Tools   12.0.30919.1
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Xamarin   4.0.381.0 (cda47a4f438cef077d8f5c0eb79fb5df835c6b99)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.99.0.144 (af4cb1e950dcbc00c3d2c365b24efc1b9fb93671)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.2.0.0 (13fec5ef6bd1d2992ae58cc5147d0e3f988792ca)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Horácio J. C. Filho 2014-10-15 00:00:20 UTC
Xamarin.Android 4.99 works in first time, but was only necessary to close the project and reopen it for this problem occurs 

:'(
Comment 2 Sadik Ali 2014-10-15 06:21:17 UTC
I have checked this issue and unable to reproduce it.

I tried following steps to reproduce it.
1.Update XVS to 4.0.318.0 (In VS Go to Tools->Xamarin->Android-> Check update in Alpha channel download and install)
2.Create a Xamarin.Android Application.
3.Run the application.

I observed that I am able to run the application successfully.

Could you please provide us steps to reproduce and sample project with build info,So that I can able to reproduce it at my end.

Let me know if I missed anything to reproduce it.

Screencast regarding Same :
http://screencast.com/t/Ptvl3re1vX
Environment Info:
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641
Installed Version: Professional
Xamarin   4.0.381.0 (cda47a4f438cef077d8f5c0eb79fb5df835c6b99)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.99.0.144 (af4cb1e950dcbc00c3d2c365b24efc1b9fb93671)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.2.0.0 (13fec5ef6bd1d2992ae58cc5147d0e3f988792ca)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 3 Horácio J. C. Filho 2014-10-15 08:24:09 UTC
@Sadik Ali Thanks for helping me :) What is your Android SDK Tools version? And Java JDK version have you installed? 32 bits ou 64 bits? 
Please, using Xamarin.Android 4.99 close the project and try to reopen it multiple times, the problem should occurs that way.
Comment 4 Horácio J. C. Filho 2014-10-15 12:10:04 UTC
I've tested it with Android SDK Tools 23.0.5 and Java JDK 6u39, it match with your installation?
Comment 5 Horácio J. C. Filho 2014-10-16 08:39:33 UTC
I've tested again and it only works well on Xamarin Studio, Visual Studio show message "The 'ResolveSdks' task failed unexpectedly" :'(
Comment 6 Sadik Ali 2014-10-17 03:50:34 UTC
@Horácio we have checked this issue with environment Info mentioned in Comment 4 and able to build and deploy application successfully.
we tried to close project,reopen it multiple times but unable to reproduce it.

Let us know if we missed anything ti reproduce it?

Screencast regarding same:
http://screencast.com/t/zZxkKeNBlh
 we checked this issue with following Environment.

Environment Info:
Java SDK Kit : 6u39 (64 bits)
Android SDK Tools: 23.0.5
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641
Installed Version: Professional
Xamarin   4.0.381.0 (cda47a4f438cef077d8f5c0eb79fb5df835c6b99)
Visual Studio extension to enable development for Xamarin.iOS and
Xamarin.Android.

Xamarin.Android   4.99.0.144 (af4cb1e950dcbc00c3d2c365b24efc1b9fb93671)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.2.0.0 (13fec5ef6bd1d2992ae58cc5147d0e3f988792ca)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 7 Horácio J. C. Filho 2014-10-17 23:07:24 UTC
@Sadik Ali Thanks a lot for helping me. 

I have tried again but unsuccessfully.

I have the same environment, JDK 6u39 (64 bits), Android SDK Tools 23.0.5, but it doesn't work for me. Before the update, i had the Xamarin 3.8.13 and it works very well, no problems occurs.

Now, using Xamarin 4.0.381.0 -
Steps for reproduce this error:
- Create a Xamarin.Android App Project
- Go to Properties -> Application
  - For default, "Compile using Android version" is setted for "Use Latest Platform".
- Change "Compile using Android version" for any API Level available in drop-down menu, i've tried with API Level 16 and 19.

The problem should occurs at this time, Visual Studio's Error List shows a similar message:
"Warning    2    The "ResolveSdks" task failed unexpectedly.
System.MissingMethodException: Method not found: 'System.String
Xamarin.AndroidTools.MonoDroidSdk.GetApiLevelForFrameworkVersion(System.String)'.
   at Xamarin.Android.Tasks.ResolveSdks.ValidateApiLevels()
   at Xamarin.Android.Tasks.ResolveSdks.Execute()
   at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at
Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()  
 Galilei
"

I've tried to investigate the problem and have noticed that in "C:\Program Files (x86)\MSBuild\Xamarin\Android\platforms" folder only there are the folders above:
"android-10"
"android-12"
"android-14"
"android-15"
"android-16"
"android-17"
"android-18"
"android-19"

There should exist a "android-20" folder for KitKat Wearable APIs and a "android-L" folder for L Preview APIs.

I've tried to investigate again, now in other folder, "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid" folder contained the folders above:
"v1.0"
"v2.3"
"v3.1"
"v4.0"
"v4.0.3"
"v4.1"
"v4.2"
"v4.3"
"v4.4"
"v5.1.0"
"v5.2.3"
"v5.3.1"
"v5.4.0"
"v5.4.0.3"
"v5.4.1"
"v5.4.2"
"v5.4.3"
"v5.4.4"
"v5.4.4.87"
"v5.4.5"

The strange thing is that does not exist the folder "v.4.4.87" (KitKat Wearable API 20) and "v4.5" (L Preview API 21) folder following the same logic.

I think there is a problem in associate "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid" contente with "C:\Program Files (x86)\MSBuild\Xamarin\Android\platforms" because Xamarin 3.8.13 has API Levels (10, 12, 14, ...) consistent with its respective SDK Version (2.3, 3.1, 4.0, ...).

I love Xamarin and really want to use the new alpha release.
Comment 8 Horácio J. C. Filho 2014-10-17 23:13:13 UTC
*content

Sorry my bad.
Comment 9 Horácio J. C. Filho 2014-10-17 23:29:38 UTC
Update:
Steps for reproduce this error:
- Create a Xamarin.Android App Project
- Go to Properties -> Application
  - For default, "Compile using Android version" is setted for "Use Latest
Platform".
- Change "Compile using Android version" for any API Level available in
drop-down menu, i've tried with API Level 16 and 19.
- ** Close the project and try to reopen **

The additional step may be necessary to reveal the error.
Comment 10 Horácio J. C. Filho 2014-10-17 23:43:20 UTC
Xamarin.Android 4.17 worked fine here but I cannot download it again from update channels for testing.
Comment 11 Horácio J. C. Filho 2014-10-18 02:07:10 UTC
@Sadik Ali

What are the API levels that you installed in your developer environment? It might help investigating.
Comment 12 Horácio J. C. Filho 2014-10-19 19:57:56 UTC
@Sadik Ali

Do you have Android L Preview platform installed in your machine yet? It is no longer possible to download it, I thought if you could send me the SDK Platform for L Preview I might test if the problem is associated with the its absence.
Comment 13 Sadik Ali 2014-10-21 06:58:10 UTC
@Horácio  

Installed API levels in my machine like API 16,API 19,API 14
Screencast regarding all Installed API level:
http://screencast.com/t/yp7ZppX5Qmq
Comment 14 Peter Collins 2014-11-25 14:02:56 UTC
This appears to be due to a partial Target Framework schema change that has since been reverted. This should no longer be an issue in the next alpha release of XA 5.0.
Comment 15 Arpit Jha 2014-11-28 02:35:36 UTC
As per comment 9 ,I am able to reproduce this issue on  builds XVS 4.0.381.1(Alpha) + VS 2012 
screencast :http://www.screencast.com/t/a0fcagS1rC

same issue doesn't exist when checked with XVS 3.9.28.0 + VS 2012 and is working fine.
screencast: http://www.screencast.com/t/4zoGn8eCt7h
Comment 16 Horácio J. C. Filho 2014-11-28 08:26:48 UTC
I'm very happy about this news, thanks a lot for help me. Where I can download Xamarin for Visual Studio 3.9.28.0? Or it is an internal alpha release of Xamarin.Android 5.0?

Thanks a lot :D
Comment 17 Arpit Jha 2014-11-28 08:49:06 UTC
Hi Horacio,

You will get the fixed build in stable channel very soon.

Thanks
Comment 18 Horácio J. C. Filho 2014-11-28 09:26:07 UTC
Hi Arpit,

This is wonderful :D Very happy, thanks a lot.