Bug 42214 - Project crashes with NRE in Main.cs - Xamarin Studio
Summary: Project crashes with NRE in Main.cs - Xamarin Studio
Status: RESOLVED DUPLICATE of bug 40911
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-06-28 16:28 UTC by man_xam
Modified: 2016-08-26 22:08 UTC (History)
3 users (show)

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 man_xam 2016-06-28 16:28:16 UTC
iOS project Main.cs - on line:  UIApplication.Main(args, null, "AppDelegate");
Xamarin Studio
on Mac El Capitan 10.11

System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Platform.iOS.Platform.DidAppear () [0x0000d] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.PlatformRenderer.ViewDidAppear (Boolean animated) [0x00006] in <filename unknown>:0
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/src/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3412/3cf8aaed/source/maccore/src/UIKit/UIApplication.cs:63
  at ContactManager.iOS.Application.Main (System.String[] args) [0x00008] in /Users/apple1/Downloads/aws-dynamodb-sdk-

Sample link:

Steps to reproduce:

1. Download sample from dropbox and run in xamarin studio
2. Run iOS sample on simulator
3. enter FB credentials.
4. After login, you should see blank list of contact
5. App crashes with null reference.
Comment 1 man_xam 2016-06-28 19:03:54 UTC
More details about the app:

This is a simple MyContacts app provided with AWS SDK. This app authenticates user with Facebook and then displays data from contacts table hosted on AWS Cloud (DynamoDB). App crashes right after authentication. Interestingly this app works on my old iPhone5 but crashes on iPad 9.0 (newer iPad) also crashes on IPhone simulator. I tried to rebuild another sample with different table but encountered same issue. 

Thanks for your help.
Comment 2 man_xam 2016-06-28 22:26:49 UTC
Sample link updated (zip created on Mac):
Comment 3 E.Z. Hart [MSFT] 2016-07-07 20:00:02 UTC
With the provided test application, I am unable to reproduce the issue. After entering FB credentials, the following error appears:

"App Not Setup: This app is still in development mode, and you don't have access to it. Switch to a registered test user or ask an app admin for permissions."
Comment 4 man_xam 2016-07-07 20:28:47 UTC
Thanks for looking into it. Do you have a FB email so I can grant you permission to the app? Alternatively I will send you a private message with temporary credentials. What is your email ID?
Comment 5 tyjen 2016-07-20 06:33:24 UTC
I am having the same problem with my app. I started using the Auth0 component in my Xamarin Forms app on iOS and Android. Everything works fine in Android and iOS simulator, but crashes on a real device every single time. :(
Comment 6 E.Z. Hart [MSFT] 2016-08-26 22:08:59 UTC
This is the same bug as reported in https://bugzilla.xamarin.com/show_bug.cgi?id=40911 - the repro project in 40911 demonstrates the issue without having to hit an outside service (e.g., Facebook).

*** This bug has been marked as a duplicate of bug 40911 ***