Bug 21904 - ModernHttpClient v2.0.1 fails on iOS8
Summary: ModernHttpClient v2.0.1 fails on iOS8
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: master
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-07 08:20 UTC by Mustafa Shaik
Modified: 2014-09-15 09:02 UTC (History)
5 users (show)

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


Attachments
iOS 8 Sample app (1.52 MB, application/zip)
2014-08-07 08:20 UTC, Mustafa Shaik
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:
RESOLVED NOT_REPRODUCIBLE

Description Mustafa Shaik 2014-08-07 08:20:34 UTC
Created attachment 7615 [details]
iOS 8 Sample app

I consumed ModernHttpClient v2.0.1 into my iOS Sample and when I ran on iOS 8 device, it fails with the following Stack-trace for an Http transaction.

2014-08-07 17:42:29.668 iOSCoreTest[403:81893] SendAsync start...
Thread started: <Thread Pool> #3
Thread started: <Thread Pool> #4
2014-08-07 17:42:29.877 iOSCoreTest[403:81893] Exception Details: 
Message: Cannot cast from source type to destination type.
Stacktrace:   at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr)
  at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject[NSUrlSessionDataTask] (IntPtr ptr, System.Type type, MissingCtorResolution missingCtorResolution) [0x00000] in <filename unknown>:0 
  at MonoTouch.ObjCRuntime.Runtime.GetNSObject[NSUrlSessionDataTask] (IntPtr ptr) [0x00000] in <filename unknown>:0 
  at MonoTouch.Foundation.NSUrlSession.CreateDataTask (MonoTouch.Foundation.NSUrlRequest request) [0x00014] in /Developer/MonoTouch/Source/monotouch/src/build/compat/Foundation/.pmcs-compat.NSUrlSession.g.cs:138 
  at ModernHttpClient.NativeMessageHandler+<SendAsync>c__async0.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62 
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Net.Http.HttpResponseMessage].GetResult () [0x00000] in <filename unknown>:0 
  at CoreTest.CoreTestViewController+<ExecuteQuery>c__async0.MoveNext () [0x000d3] in /Volumes/HDD/Working/Projects/Tesco/TFS/Ccube/Samples/SendAsyncCoreTest/APIFails/iOSCoreTest-Individual/CoreTest/CoreTestViewController.cs:46 


Regards
Mustafa Shaik
Comment 1 Udham Singh 2014-08-07 09:57:35 UTC
I have checked this issue and observed the same behavior mentioned in bug description. To reproduce this issue I have followed the steps mentioned below:

1. Run 'iOS 8 Sample app' application attached in bug description.
2. Launch the application on iPhone 4S(iOS 8) device by tapping manually with Xcode 5.1
3. Click on Start button and got the exception in application output.

Screencast : http://screencast.com/t/70hEb0jJXT

Application Output : https://gist.github.com/anonymous/6317bf524eb725ea5522
Ide Log : https://gist.github.com/anonymous/067c48b84ba13f76464d
iOS Device Log : https://gist.github.com/anonymous/e801b1ea910805155bd2

Environment Info : 

=== Xamarin Studio ===

Version 5.2 (build 386)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.6.0 ((no/f540f8a)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 306000039

=== Xamarin.Android ===

Version: 4.14.0 (Enterprise Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		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)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: 7.2.6.28 (Enterprise Edition)
Hash: 606f31a
Branch: 
Build date: 2014-08-01 15:27:48-0400

=== Xamarin.Mac ===

Version: 1.10.0.4 (Enterprise Edition)

=== Build Information ===

Release ID: 502000386
Git revision: e6a54dee5376e6e7a2d9982695b060fddc09e65d
Build date: 2014-08-04 14:03:28-04
Xamarin addins: 2b5a5c26ac2ee74c6e91a8d24ef44d0ca9cb74d0

=== Operating System ===

Mac OS X 10.9.2
Darwin MacMini.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 2 Alex Soto [MSFT] 2014-09-02 17:05:09 UTC
Hello 

I have tried to duplicate this issue but I can't repro with provided sample, this is what I get

http://screencast.com/t/N51TxcVHZ

if you can still duplicate this using the latest XI 7.9.x and iOS8 betas please re-open.
Comment 3 Fabien Molinet 2014-09-13 13:43:46 UTC
Hi,

I have a similar issue with an app built for iOS7 that uses ModernHttpClient 2.0.1, and runs on iOS8.

System.InvalidCastException: Cannot cast from source type to destination type.
at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr)
at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject[NSUrlSessionDataTask] (IntPtr ptr, System.Type type, MissingCtorResolution missingCtorResolution) [0x00000] in <filename unknown>:0
at MonoTouch.ObjCRuntime.Runtime.GetNSObject[NSUrlSessionDataTask] (IntPtr ptr) [0x00000] in <filename unknown>:0
at MonoTouch.Foundation.NSUrlSession.CreateDataTask (MonoTouch.Foundation.NSUrlRequest request) [0x00000] in <filename unknown>:0
at ModernHttpClient.NativeMessageHandler+<SendAsync>c__async0.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[System.Net.Http.HttpResponseMessage].GetResult () [0x00000] in <filename unknown>:0
at System.Net.Http.HttpClient+<SendAsyncWorker>c__async0.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[System.Net.Http.HttpResponseMessage].GetResult () [0x00000] in <filename unknown>:0
at HGR.Mobile.Infrastructure.BaseService+<GetInternalAsync>c__async9.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[System.Object].GetResult () [0x00000] in <filename unknown>:0
at HGR.Mobile.Infrastructure.BaseService+<GetAsync>c__async1`1[System.Byte[]].MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[System.Byte[]].GetResult () [0x00000] in <filename unknown>:0
at HGR.Mobile.Plugins.FileDownloadService+<DownloadAsync>c__async0.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[System.Byte[]].GetResult () [0x00000] in <filename unknown>:0
at HGR.Mobile.Plugins.FileDownloadRequest+<DownloadAsync>c__async0.MoveNext () [0x00000] in <filename unknown>:0

If you want to reproduce this issue we have our app on the AppStore just here:
https://itunes.apple.com/de/app/mediathek-kataloge-und-broschuren/id899482238?mt=8
Comment 4 Fabien Molinet 2014-09-13 17:13:41 UTC
I confirm that an app previously compiled for iOS7 and uses ModernHttpClient won't work on iOS8...
Instead you need to recompile it with Xam.iOS8 but you can still target iOS7 with --registrar:legacy

Then it works.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2014-09-15 09:02:48 UTC
This is fixed already, and the fix will be included in the next preview version of Xamarin.iOS 8.0 (any version >= 8.0.0.11)