Bug 56864 - [VS 2017 XA Self Hosted VSIX] Getting exception "System.ArgumentNullException: Value cannot be null" when deploying android App
Summary: [VS 2017 XA Self Hosted VSIX] Getting exception "System.ArgumentNullException...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.4 (15.3)
Hardware: PC Windows
: Highest blocker
Target Milestone: 15.3
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2017-05-26 10:21 UTC by Mohak Barokar
Modified: 2017-06-02 10:13 UTC (History)
7 users (show)

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


Attachments
Deployment Errors, Ide Logs and Warnings (88.47 KB, application/x-zip-compressed)
2017-05-26 10:21 UTC, Mohak Barokar
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 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 Mohak Barokar 2017-05-26 10:21:53 UTC
Created attachment 22488 [details]
Deployment Errors, Ide Logs and Warnings

Unable to deploy Android App on Emulator or Device in Release and Debug mode getting "System.ArgumentNullException: Value cannot be null" Exception when app is deployed

====================================================================================

Observations:
1. Getting Build Warnings in only Release mode but not in Debug mode

====================================================================================

Environment Info:
 -Microsoft Visual Studio Enterprise 2017 Preview
 -Version 15.3 (26510.0-Preview) Preview
 -Xamarin   4.6.0.620 (101846a)
 -Xamarin.iOS and Xamarin.Mac SDK   10.10.0.30 (30b6e87)
 -Xamarin.Android.Sdk.7.3.99.61

Platform: Windows 10

Detailed Environment Info: https://gist.github.com/mohakbarokar/0f8b57f2169f374f1020f97e67c190f2

====================================================================================

Build Link: 
https://bosstoragemirror.azureedge.net/wrench/monodroid-mavericks-master/26/26faff73e8aab2f2872575c0a291a112c152c80f/Xamarin.Android.Sdk.7.3.99.61.vsix


Trello Card Link:
https://trello.com/c/9YtCZI3P/23-xa-self-hosted-vsix

====================================================================================

Steps:
1. Create Android App
2. Build and Deploy Android App on Emulator/Device in Debug/Release Mode
3. Observe Deployment of Build

====================================================================================

Expected Result: 
Application should be deployed successfully on Emulator/Device

Actual Result: 
Application is not getting deployed with Exception : "System.ArgumentNullException: Value cannot be null"

====================================================================================


Reproducibility: 100%

====================================================================================

Screencast Link: http://www.screencast.com/t/2fUhW9nHAU

====================================================================================

Build Output and IDE Logs Attached.
Comment 1 Jonathan Pryor 2017-05-26 12:19:30 UTC
For simplicity, the offending stack trace:

> System.ArgumentNullException: Value cannot be null.
> Parameter name: path1
>    at System.IO.Path.Combine(String path1, String path2, String path3, String path4)
>    at Xamarin.AndroidTools.PlatformPackage.GetPlatformPackageVersion(Int32 apiLevel, String& packageName)
>    at AndroidDeviceExtensions.<GetPackageVersionsAsync>d__33.MoveNext()
> --- End of stack trace from previous location where exception was thrown ---
>    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
>    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
>    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
>    at AndroidDeviceExtensions.<GetPackagesAsync>d__27.MoveNext()
> --- End of stack trace from previous location where exception was thrown ---
>    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
>    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
>    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
>    at Xamarin.AndroidTools.AndroidDeploySession.<RunAsync>d__101.MoveNext()
> --- End of stack trace from previous location where exception was thrown ---
>    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
>    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
>    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
>    at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>d__99.MoveNext()
Comment 2 Jonathan Pryor 2017-05-30 20:26:16 UTC
(Hopefully!) Fixed in androidtools/master/7138567f and monodroid/master/0659c863.

Many thanks to Kzu and Juan Tondato in tracking this down.