1

I want to start off saying that I have reviewed the many posts about iOS app crashing only for Apple Review Team and I did not find a solution and also did find one with my crash log information.

This is a Xamarin.Forms project. I have a PCL with Droid and iOS projects. My Droid project works great. I have no issues there. My iOS project is where I am having issues. I can debug this without any hiccups. I have tested this on the various simulators via XCode and also multiple real devices. I constantly get my app rejected by Apple saying the app crashes when it does a certain action. I have tried numerous times to duplicate the crash but I cannot.

I have symbolicated the crash log from Apple and it can be viewed with this link. I do not see anywhere in the crash log that shows my code and what I did wrong. I think it has something to do with me doing async/await stuff but I cannot confirm this.

If it helps, I am using version 2.2.0.31 of Xamarin.

I am new to Apple crash logs and I find them very hard to decipher. Can someone please assist with helping figure out what I am doing wrong.

UPDATE

Included is the code that was requested.

iOS project -- Main.cs

public class Application
    {
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }
    }

iOS project -- AppDelegate.cs

public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            App.ScreenWidth = (int)UIScreen.MainScreen.Bounds.Width;
            App.ScreenHeight = (int)UIScreen.MainScreen.Bounds.Height;

            UINavigationBar.Appearance.TintColor = UIColor.FromRGB(40, 51, 65);

            FormsMaps.Init();
            AdvancedTimerImplementation.Init();
            CachedImageRenderer.Init();

            LoadApplication(new App());

            return base.FinishedLaunching(app, options);
        }

Shared project -- App.cs

    public App()
            {
                //do the initial setup
                var nav = new NavigationService();
                if (!SimpleIoc.Default.IsRegistered<INavigationServiceEx>())
                    SimpleIoc.Default.Register<INavigationServiceEx>(() => nav);

                var apiMgr = new ApiManager();
                if (!SimpleIoc.Default.IsRegistered<ApiManager>())
                    SimpleIoc.Default.Register<ApiManager>(() => apiMgr);

                var storageMgr = new StorageManager();
                if (!SimpleIoc.Default.IsRegistered<StorageManager>())
                    SimpleIoc.Default.Register<StorageManager>(() => storageMgr);

                var externalMaps = DependencyService.Get<IExternalMaps>();
                if (!SimpleIoc.Default.IsRegistered<IExternalMaps>())
                    SimpleIoc.Default.Register<IExternalMaps>(() => externalMaps);

                var mediaService = DependencyService.Get<IMedia>();
                mediaService.Initialize();
                if (!SimpleIoc.Default.IsRegistered<IMedia>())
                    SimpleIoc.Default.Register<IMedia>(() => mediaService);

                var geolocationService = DependencyService.Get<IGeolocator>();
                if (!SimpleIoc.Default.IsRegistered<IGeolocator>())
                    SimpleIoc.Default.Register<IGeolocator>(() => geolocationService);

                nav.Configure(ViewModelLocator.StartupPage, typeof(StartupView));
                nav.Configure(ViewModelLocator.LoginPage, typeof(LoginView));
                nav.Configure(ViewModelLocator.RegisterPage, typeof(RegisterView));
                nav.Configure(ViewModelLocator.QouponsPage, typeof(QouponsView));
                nav.Configure(ViewModelLocator.UserProfilePage, typeof(UserProfileView));
                nav.Configure(ViewModelLocator.EditUserProfilePage, typeof(EditUserProfileView));
                nav.Configure(ViewModelLocator.CompanyPage, typeof(CompanyView));


  nav.Configure(ViewModelLocator.RedeemPage, typeof(RedeemView));
            nav.Configure(ViewModelLocator.SettingsPage, typeof(SettingsView));
            nav.Configure(ViewModelLocator.HelpPage, typeof(HelpView));

            var startupView = new StartupView();
            var startupPage = new NavigationPage(startupView);
            startupPage.BarBackgroundColor = Color.FromHex("#FF8A07");

            nav.Initialize(startupPage);
            startupView.Start();

            MainPage = startupPage;
        }
Travyguy9
  • 4,774
  • 8
  • 43
  • 63

2 Answers2

2

Something in your async code threw an exception, and there doesn't seem to be an exception handler for that exception (an exception without an exception handler will crash the process).

This is from your main thread where it shows the async runtime logic throwing the exception on the main thread:

13  QneoiOS 0x000000010023039c System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 44
14  QneoiOS 0x000000010022eea0 System_Runtime_CompilerServices_AsyncMethodBuilderCore__ThrowAsyncm__0_object + 80
15  QneoiOS 0x0000000100b3b798 UIKit_UIKitSynchronizationContext__Postc__AnonStorey0__m__0 (UIKitSynchronizationContext.cs:24)
16  QneoiOS 0x0000000100b55fd4 Foundation_NSAsyncActionDispatcher_Apply (NSAction.cs:163)

You need more details about this exception, the crash report doesn't contain enough information to diagnose further.

My suggestion would be to add a crash-reporting solution (such as Xamarin Insights), resubmit, and then you should get information about the exception in Xamarin Insights when the crash occurs during Apple's review.

Rolf Bjarne Kvinge
  • 19,253
  • 2
  • 42
  • 86
  • I did do that and found the issue. It would be almost impossible for someone to know the answer (like you said) so I will accept yours as the answer. The issue was the fact that a library I was using (IAdvancedTimer - https://github.com/ufuf/AdvancedTimer) was always null in release mode. I guess it has happened to others as well. I implemented his code and locally and now it works. – Travyguy9 May 18 '16 at 12:57
0

I had a similar problem. Moved to Xamarin in Microsoft Studio and it worked on devices & simulator in debug and on simulator in release mode but was crashing in testflight and review. My solution was two things: I changed the linker setting to Link SDKs rather than Link All. I revoked by release certificate and recreated that with a new distribution provisioning profile. This fixed the problem for me. Hope it helps someone else.

JanB
  • 904
  • 9
  • 14