Bug 55412 - Xamarin.Android httpClient.GetAsync() CancellationTokenSource delay ArgumentOutOfRangeException
Summary: Xamarin.Android httpClient.GetAsync() CancellationTokenSource delay Argument...
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.2 (15.1)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2017-04-19 21:09 UTC by rfreschi
Modified: 2017-06-26 18:13 UTC (History)
3 users (show)

Tags: bb
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 rfreschi 2017-04-19 21:09:01 UTC
Suddenly started seeing exception at this line. Called from Xamarin.Android Forms PCL project.
Only Release builds to devices are failing.
Debug to sims and devices, and Release to sims are working fine.

var response = await httpClient.GetAsync(location).ConfigureAwait(false);

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
[AndroidRuntime] Parameter name: delay
[AndroidRuntime]   at System.Threading.CancellationTokenSource.CancelAfter (System.TimeSpan delay) <0x94cb72f4 + 0x000a8> in <8c304e4006094a46a7950338a3b3cb5d>:0 
[AndroidRuntime]   at System.Net.Http.HttpClient+<SendAsyncWorker>c__async0.MoveNext () [0x0005b] in <33125f85abf045418d5a40b4ae0d9bb5>:0 

Been debugging for two days now trying to see if this is a plugin or a platform issue with no luck.

=== Xamarin Studio Community ===

Version 6.3 (build 863)
Installation UUID: e44ee3c3-97ed-466c-ba3f-45fea5b1be52
	Mono (2017-02/851b6c7) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500000048

=== NuGet ===


=== Xamarin.Profiler ===

Version: 1.4.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.1 (12170)
Build 8E1000a

=== Xamarin.iOS ===

Version: (Xamarin Studio Community)
Hash: a04678c2
Branch: d15-1
Build date: 2017-03-28 14:05:38-0400

=== Xamarin.Android ===

Version: (Xamarin Studio Community)
Android SDK: /Users/rfreschi/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
		7.0    (API level 24)
		7.1    (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.2

Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Android Designer EPL code available here:

=== Xamarin.Mac ===

Version: (Xamarin Studio Community)

=== Xamarin Inspector ===

Version: 1.2.1
Hash: 0ea0a12
Branch: d15-1
Build date: Thu, 06 Apr 2017 20:24:44 GMT

=== Build Information ===

Release ID: 603000863
Git revision: a2163670efe259c85cd8f335d95b175068fbbe2a
Build date: 2017-04-03 14:33:15-04
Xamarin addins: 2045d688ea1420e0381b473360ca62a763eb7d04
Build lane: monodevelop-lion-d15-1

=== Operating System ===

Mac OS X 10.12.4
Darwin HPSJ-iMac.local 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Gorilla Player
Comment 1 rdurfee 2017-05-09 15:21:26 UTC
We are seeing this error as well, but only when AOT is enabled.
Comment 2 Mark McLemore 2017-06-23 18:25:27 UTC
(In reply to rfreschi from comment #0)

Hi, can you provide access to the project (or attach a test case) so we can reproduce it on this end? Thanks!
Comment 3 rfreschi 2017-06-26 17:51:22 UTC
I'm not seeing this issue anymore. I assume it was fixed via an update.
Comment 4 Mark McLemore 2017-06-26 18:13:32 UTC
Thanks for letting us know!