Bug 14246 - Mobile application SoMA[iOS] throwing exception.
Summary: Mobile application SoMA[iOS] throwing exception.
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Samples ()
Version: 6.4.4
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Oleg Demchenko
URL:
: 14263 ()
Depends on:
Blocks:
 
Reported: 2013-08-26 13:51 UTC by Mohit Kheterpal
Modified: 2014-01-27 15:02 UTC (History)
5 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:
RESOLVED FIXED

Description Mohit Kheterpal 2013-08-26 13:51:20 UTC
Steps to Reproduce :
1. Open XS 
2. Deploy SoMA Application on Device/Simulator
3. Click on "New Share"

Case 1 :
After click on New Share when we click on 'Cancel' it throws "System.Threading.Tasks.TaskCanceledException".

Supplement info :
https://gist.github.com/saurabh360/ac26b9a5f205a34bcc90

Case 2 :
a. Take a picture 
b. Click on app.net
c. Click on Add Account

When we click on add account it throws "System.InvalidOperationException"

Supplement info :
https://gist.github.com/saurabh360/7974ff28fd1e8656f0b6


Expected : It should not throws any Exception and application run successfully.

Environment info :
All Mac
XS 4.1.9 (build 6)
MT 6.4.4.11
Xcode 4.4.1, 4.5, 4.6.2
Mono 3.2.2 ((no/a0fc6ba)

Device info :
iPhone 5 (OS 6.0.2)

Regression Status : New Sample Application. Never Seen
Comment 1 GouriKumari 2014-01-02 15:53:42 UTC
For Case 1:

I added a try - catch around await pickertask in PhotoScreen.cs

Please see: On clicking the cancel button, the app will now move to share screen. If you click on any share services like Flickr/App.net/Twitter or Facebook

For Case2:

I added a redirect url for app.Net to fix System.InvalidOperationException
Comment 2 GouriKumari 2014-01-02 16:00:13 UTC
Saved without finishing the comment:

For Case 1:

I added a try - catch around await pickertask in PhotoScreen.cs

Please see: On clicking the cancel button, the app will now move to share
screen. If you click on any share services like Flickr/App.net/Twitter or
Facebook without taking an image, Argument Null Reference Exception will be thrown (This has to be fixed
in the sample).

However, the System.Threading.Tasks.Exception is fixed.

For Case2:

I added a redirect url for app.Net to fix System.InvalidOperationException

@Craig: Could you also take a look at the sample and make changes if the fix provided is not appropriate.

Tested with:

Xamarin.iOS
Version: 7.0.4.209 (Enterprise Edition)
Hash: 23a0827
iPodtouch 7.0.4
Comment 3 GouriKumari 2014-01-02 16:09:14 UTC
*** Bug 14263 has been marked as a duplicate of this bug. ***
Comment 4 CraigD 2014-01-03 20:09:58 UTC
Seems fine! I fixed the NRE when there's no image (and also tweaked the UITableView for iOS7).
Comment 5 Saurabh 2014-01-07 08:28:33 UTC
Unable to verify this issue with latest mobile sample, as we are getting an other issue with "SoMA" iOS of mobile repo: 
https://bugzilla.xamarin.com/show_bug.cgi?id=17089

Thanks!
Comment 6 Saurabh 2014-01-07 09:50:21 UTC
I have checked this issue with latest mobile samples and stable environment:

mobile-samples-master-4e5cdac66dea7d9e09ef4672edd6d6214e7720a8
Stable XS 4.2.2(Build 2) 
X.iOS 7.0.4.209
Xcode 5.0.1 (3335.6)

Case 1:
Click on 'Cancel' and wait for few second, observe that application throws same exception "System.Threading.Tasks.TaskCanceledException" in few second.

Error details:
System.Threading.Tasks.TaskCanceledException: The Task was canceled
  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[Xamarin.Geolocation.Position].GetResult () [0x00000] in <filename unknown>:0
  at SoMA.PhotoScreen+<ViewWillAppear>c__async0.MoveNext () [0x00356] in /Users/apple/Desktop/6Jan14/mobile-samples-master/SoMA/iOS/PhotoScreen.cs:102

Hence, reopening this issue.
Comment 7 GouriKumari 2014-01-07 11:09:45 UTC
I couldn't reproduce this issue with stable Xamarin.iOS 7.0.4.209. 

Test Env:

XS 4.2.2(Build 2) 
X.iOS 7.0.4.209
Xcode 5.0.1 

Device info: iPodTouch 5 gen 7.0.4

@Saurabh : Can you add the device details as well.
Comment 8 Saurabh 2014-01-07 13:29:46 UTC
I have used iPhone iOS 7.0.4

Afetr Clicking on 'Cancel' you have to wait for few second, observe that application throws exception "System.Threading.Tasks.TaskCanceledException" in few second.
Comment 9 GouriKumari 2014-01-07 15:34:15 UTC
@Saurabh,

Sample has been updated today with fixes. Could you retest again.
Comment 10 Saurabh 2014-01-08 06:25:08 UTC
Today, I have tried it with latest mobile sample and still getting same issue.

mobile-samples-master-dc6f349a56196897759dd4ce3bd3416a15aaca20

On "New Share" and then on clicking on 'Cancel', Use current location popup appears(http://www.screencast.com/t/9QhBLxcRB), now wait about 20 seconds, you will get that application throws exception "System.Threading.Tasks.TaskCanceledException" in
few second.


Screencast: http://screencast.com/t/52lbnvfEbesi
Application output: https://gist.github.com/atin360/e9504dcbda8e676c8415

Error: 
System.Threading.Tasks.TaskCanceledException: The Task was canceled
  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[Xamarin.Geolocation.Position].GetResult () [0x00000] in <filename unknown>:0
  at SoMA.PhotoScreen+<ViewWillAppear>c__async0.MoveNext () [0x00419] in /Users/apple/Desktop/XamarinSampleApplications/8thJan14/mobile-samples-master/SoMA/iOS/PhotoScreen.cs:114


Stable XS 4.2.2(Build 2) 
X.iOS 7.0.4.209
Xcode 5.0.1 (3335.6)

Device info: iPhone 4S iOS 7.0.4
Comment 11 Saurabh 2014-01-08 09:22:59 UTC
Also getting same issue with with latest build:

XS 4.2.3(Build 29)
X.iOS 7.0.6.166
Xcode 5.0.1 (3335.6)

Device info: iPhone 4S iOS 7.0.4

mobile-samples-master-dc6f349a56196897759dd4ce3bd3416a15aaca20
Comment 12 Oleg Demchenko 2014-01-27 14:19:18 UTC
Reproduced System.Threading.Tasks.TaskCanceledException, also find two new bugs:
1) Table items hidden behind navigation bar: http://screencast.com/t/4lDWJ8Ws
2) Crash on table item click: http://screencast.com/t/U0PLwlV5bT2

Environment details:
OS X 10.9.1
Xamarin Studio 4.2.3
Xamarin.iOS 7.0.6.168
Comment 13 Oleg Demchenko 2014-01-27 15:02:15 UTC
1) Fix commit for nav bar issues: 7f6be534fc1412ed8a5888686954dfadab65ec06
2) Fix commit for crash on table item click: 9fa5401e12b27c0cb43716b6c5f6aeb7ce9ffa79
3) fix commit for System.Threading.Tasks.TaskCanceledException: d9ea5b425e2ace6c10cf4197122d2847cf352ea1