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;
}