Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Crash on startup of default template #30

Closed
davidortinau opened this issue Jan 11, 2020 · 16 comments · Fixed by #51 or #76
Closed

[iOS] Crash on startup of default template #30

davidortinau opened this issue Jan 11, 2020 · 16 comments · Fixed by #51 or #76
Assignees
Milestone

Comments

@davidortinau
Copy link

@davidortinau davidortinau commented Jan 11, 2020

The app starts to launch, and then crashes. Using the default template.

MobileBlazorBindings: 0.1.173-beta
Xamarin.Forms: 4.3.0
iOS: 13.3

Same app runs fine on Android emulator.

Screenshot 2020-01-10 18 28 36

System.PlatformNotSupportedException: Operation is not supported on this platform.
  at System.IO.FileSystemWatcher.StartRaisingEvents () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.UnknownUnix.cs:23 
  at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed () [0x00019] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs:664 
  at System.IO.FileSystemWatcher.set_EnableRaisingEvents (System.Boolean value) [0x0001d] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs:163 
  at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher () [0x00038] in <6125f79e68ba4e3e9fe4648a1c0d0d0f>:0 
  at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken (System.String filter) [0x00033] in <6125f79e68ba4e3e9fe4648a1c0d0d0f>:0 
  at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch (System.String filter) [0x00024] in <6125f79e68ba4e3e9fe4648a1c0d0d0f>:0 
  at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__1_0 () [0x00016] in <9ec7d2c6e7554a1f850c7aff61ce2685>:0 
  at Microsoft.Extensions.Primitives.ChangeToken+ChangeTokenRegistration`1[TState]..ctor (System.Func`1[TResult] changeTokenProducer, System.Action`1[T] changeTokenConsumer, System.Action state) [0x0001b] in <188ebf9f0e17409ba16a3263816f0064>:0 
  at Microsoft.Extensions.Primitives.ChangeToken.OnChange (System.Func`1[TResult] changeTokenProducer, System.Action changeTokenConsumer) [0x0001c] in <188ebf9f0e17409ba16a3263816f0064>:0 
  at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor (Microsoft.Extensions.Configuration.FileConfigurationSource source) [0x00035] in <9ec7d2c6e7554a1f850c7aff61ce2685>:0 
  at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider..ctor (Microsoft.Extensions.Configuration.Json.JsonConfigurationSource source) [0x00000] in <8ee38c187c6b4daab5dd2c1ede9b3141>:0 
  at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build (Microsoft.Extensions.Configuration.IConfigurationBuilder builder) [0x00007] in <8ee38c187c6b4daab5dd2c1ede9b3141>:0 
  at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build () [0x0001a] in <df2ca259d3bf4c2fa98021b4434110b3>:0 
  at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration () [0x0005c] in <07930773021a4a4eb35f7d8403f80d9c>:0 
  at Microsoft.Extensions.Hosting.HostBuilder.Build () [0x0002c] in <07930773021a4a4eb35f7d8403f80d9c>:0 
  at FirstMobileBlazorBindingsApp.App..ctor () [0x00008] in /Users/davidortinau/work/FirstMobileBlazorBindingsApp/FirstMobileBlazorBindingsApp/App.cs:12 
  at FirstMobileBlazorBindingsThread started: <Thread Pool> #6
App.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00007] in /Users/davidortinau/work/FirstMobileBlazorBindingsApp/FirstMobileBlazorBindingsApp.iOS/AppDelegate.cs:26 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.8.3.0/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.8.3.0/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at FirstMobileBlazorBindingsApp.iOS.Application.Main (System.String[] args) [0x00001] in /Users/davidortinau/work/FirstMobileBlazorBindingsApp/FirstMobileBlazorBindingsApp.iOS/Main.cs:17
2020-01-10 18:28:58.316995-0600 FirstMobileBlazorBindingsApp.iOS[5500:60922] Unhandled managed exception: Operation is not supported on this platform. (System.PlatformNotSupportedException)
  at System.IO.FileSystemWatcher.StartRaisingEvents () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.UnknownUnix.cs:23 
  at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed () [0x00019] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs:664 
  at System.IO.FileSystemWatcher.set_EnableRaisingEvents (System.Boolean value) [0x0001d] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs:163 
  at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher () [0x00038] in <6125f79e68ba4e3e9fe4648a1c0d0d0f>:0 
  at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken (System.String filter) [0x00033] in <6125f79e68ba4e3e9fe4648a1c0d0d0f>:0 
  at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch (System.String filter) [0x00024] in <6125f79e68ba4e3e9fe4648a1c0d0d0f>:0 
  at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__1_0 () [0x00016] in <9ec7d2c6e7554a1f850c7aff61ce2685>:0 
  at Microsoft.Extensions.Primitives.ChangeToken+ChangeTokenRegistration`1[TState]..ctor (System.Func`1[TResult] changeTokenProducer, System.Action`1[T] changeTokenConsumer, System.Action state) [0x0001b] in <188ebf9f0e17409ba16a3263816f0064>:0 
  at Microsoft.Extensions.Primitives.ChangeToken.OnChange (System.Func`1[TResult] changeTokenProducer, System.Action changeTokenConsumer) [0x0001c] in <188ebf9f0e17409ba16a3263816f0064>:0 
  at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor (Microsoft.Extensions.Configuration.FileConfigurationSource source) [0x00035] in <9ec7d2c6e7554a1f850c7aff61ce2685>:0 
  at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider..ctor (Microsoft.Extensions.Configuration.Json.JsonConfigurationSource source) [0x00000] in <8ee38c187c6b4daab5dd2c1ede9b3141>:0 
  at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build (Microsoft.Extensions.Configuration.IConfigurationBuilder builder) [0x00007] in <8ee38c187c6b4daab5dd2c1ede9b3141>:0 
  at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build () [0x0001a] in <df2ca259d3bf4c2fa98021b4434110b3>:0 
  at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration () [0x0005c] in <07930773021a4a4eb35f7d8403f80d9c>:0 
  at Microsoft.Extensions.Hosting.HostBuilder.Build () [0x0002c] in <07930773021a4a4eb35f7d8403f80d9c>:0 
  at FirstMobileBlazorBindingsApp.App..ctor () [0x00008] in /Users/davidortinau/work/FirstMobileBlazorBindingsApp/FirstMobileBlazorBindingsApp/App.cs:12 
  at FirstMobileBlazorBindingsApp.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00007] in /Users/davidortinau/work/FirstMobileBlazorBindingsApp/FirstMobileBlazorBindingsApp.iOS/AppDelegate.cs:26 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.8.3.0/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.8.3.0/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at FirstMobileBlazorBindingsApp.iOS.Application.Main (System.String[] args) [0x00001] in /Users/davidortinau/work/FirstMobileBlazorBindingsApp/FirstMobileBlazorBindingsApp.iOS/Main.cs:17

=================================================================
	Native Crash Reporting
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
	Native stacktrace:
=================================================================
	0x104782915 - /Users/davidortinau/Library/Developer/CoreSimulator/Devices/119E7A4E-1B2A-4EA1-8462-D73AB01C96E6/data/Containers/Bundle/Application/6A7377A3-EB30-45AC-A438-28D052E7C4DB/FirstMobileBlazorBindingsApp.iOS.app/FirstMobileBlazorBindingsApp.iOS : mono_dump_native_crash_info
	0x1047770e5 - /Users/davidortinau/Library/Developer/CoreSimulator/Devices/119E7A4E-1B2A-4EA1-8462-D73AB01C96E6/data/Containers/Bundle/Application/6A7377A3-EB30-45AC-A438-28D052E7C4DB/FirstMobileBlazorBindingsApp.iOS.app/FirstMobileBlazorBindingsApp.iOS : mono_handle_native_crash
	0x104781e9b - /Users/davidortinau/Library/Developer/CoreSimulator/Devices/119E7A4E-1B2A-4EA1-8462-D73AB01C96E6/data/Containers/Bundle/Application/6A7377A3-EB30-45AC-A438-28D052E7C4DB/FirstMobileBlazorBindingsApp.iOS.app/FirstMobileBlazorBindingsApp.iOS : sigabrt_signal_handler
	0x7fff5245b42d - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_platform.dylib : _sigtramp
	0x7f8eb082e000 - Unknown
	0x7fff5234ba5c - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib : abort
	0x1049ac11f - /Users/davidortinau/Library/Developer/CoreSimulator/Devices/119E7A4E-1B2A-4EA1-8462-D73AB01C96E6/data/Containers/Bundle/Application/6A7377A3-EB30-45AC-A438-28D052E7C4DB/FirstMobileBlazorBindingsApp.iOS.app/FirstMobileBlazorBindingsApp.iOS : xamarin_unhandled_exception_handler
	0x1048385f7 - /Users/davidortinau/Library/Developer/CoreSimulator/Devices/119E7A4E-1B2A-4EA1-8462-D73AB01C96E6/data/Containers/Bundle/Application/6A7377A3-EB30-45AC-A438-28D052E7C4DB/FirstMobileBlazorBindingsApp.iOS.app/FirstMobileBlazorBindingsApp.iOS : mono_invoke_unhandled_exception_hook
	0x104776c99 - /Users/davidortinau/Library/Developer/CoreSimulator/Devices/119E7A4E-1B2A-4EA1-8462-D73AB01C96E6/data/Containers/Bundle/Application/6A7377A3-EB30-45AC-A438-28D052E7C4DB/FirstMobileBlazorBindingsApp.iOS.app/FirstMobileBlazorBindingsApp.iOS : mono_handle_exception_internal
	0x104775129 - /Users/davidortinau/Library/Developer/CoreSimulator/Devices/119E7A4E-1B2A-4EA1-8462-D73AB01C96E6/data/Containers/Bundle/Application/6A7377A3-EB30-45AC-A438-28D052E7C4DB/FirstMobileBlazorBindingsApp.iOS.app/FirstMobileBlazorBindingsApp.iOS : mono_handle_exception
	0x1046f92f9 - /Users/davidortinau/Library/Developer/CoreSimulator/Devices/119E7A4E-1B2A-4EA1-8462-D73AB01C96E6/data/Containers/Bundle/Application/6A7377A3-EB30-45AC-A438-28D052E7C4DB/FirstMobileBlazorBindingsApp.iOS.app/FirstMobileBlazorBindingsApp.iOS : mono_amd64_throw_exception
	0x106cb55b0 - Unknown
	0x10b2d6e4b - Unknown
	0x10b2cbf74 - Unknown
	0x10b28f81b - Unknown

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x7fff523bc7fa):0x7fff523bc7ea  ff ff c3 90 90 90 b8 48 01 00 02 49 89 ca 0f 05  .......H...I....
0x7fff523bc7fa  73 08 48 89 c7 e9 85 a2 ff ff c3 90 90 90 b8 53  s.H............S
0x7fff523bc80a  00 00 02 49 89 ca 0f 05 73 08 48 89 c7 e9 6d a2  ...I....s.H...m.
0x7fff523bc81a  ff ff c3 90 90 90 b8 83 01 00 02 49 89 ca 0f 05  ...........I....

=================================================================
	Managed Stacktrace:
=================================================================
=================================================================
@Eilon

This comment has been minimized.

Copy link
Collaborator

@Eilon Eilon commented Jan 11, 2020

Hmm I think I've seen someone report something like this before. Might have to figure out how to disable the file watchers at least on iOS, but perhaps everywhere (they're not super meaningful in a mobile app).

@Alienroid

This comment has been minimized.

Copy link

@Alienroid Alienroid commented Jan 15, 2020

same issue.

@Eilon

This comment has been minimized.

Copy link
Collaborator

@Eilon Eilon commented Jan 15, 2020

Sorry you're running into it. I will investigate ASAP.

@gpproton

This comment has been minimized.

Copy link

@gpproton gpproton commented Jan 15, 2020

I'm also experiencing this issue even on Xamarin.Forms: 4.4

@fred-perkins

This comment has been minimized.

Copy link

@fred-perkins fred-perkins commented Jan 15, 2020

+1 for getting this issue from the current 173 preview.

@Eilon

This comment has been minimized.

Copy link
Collaborator

@Eilon Eilon commented Jan 15, 2020

Yeah the problem isn't with Xamarin.Forms or Blazor, it's with the Generic Host that's used in App.cs. I need to see how to disable the file watcher.

@Eilon Eilon added this to the 0.2.0-preview milestone Jan 17, 2020
@Eilon Eilon self-assigned this Jan 21, 2020
Eilon added a commit that referenced this issue Jan 21, 2020
- In particular, it removes some configuration and logging stuff that's in the default Host

Fixes #30
@Eilon Eilon closed this in #51 Jan 21, 2020
Eilon added a commit that referenced this issue Jan 21, 2020
- In particular, it removes some configuration and logging stuff that's in the default Host

Fixes #30
@Bruno2049

This comment has been minimized.

Copy link

@Bruno2049 Bruno2049 commented Jan 24, 2020

With the MobileBlazorBindingsHost the "operation not supported" error it's solved, but now the is error because any view controller get created.

image

Here is the exception:

Foundation.MonoTouchException
  Message=Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: Application windows are expected to have a root view controller at the end of application launch
Native stack trace:
	0   CoreFoundation                      0x00007fff23c7127e __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff513fbb20 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff23c70ff8 +[NSException raise:format:arguments:] + 88
	3   Foundation                          0x00007fff256e9b51 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
	4   UIKitCore                           0x00007fff48091307 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2252
	5   UIKitCore                           0x00007fff477c576d -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122
	6   UIKitCore                           0x00007fff47cb44c1 _UIScenePerformActionsWithLifecycleActionMask + 83
	7   UIKitCore                           0x00007fff477c627f __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198
	8   UIKitCore                           0x00007fff477c5c8e -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 296
	9   UIKitCore                           0x00007fff477c60ac -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 818
	10  UIKitCore                           0x00007fff477c5941 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345
	11  UIKitCore                           0x00007fff477c9f3f __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 178
	12  UIKitCore                           0x00007fff47bd8c83 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 865
	13  UIKitCore                           0x00007fff47cd2dff _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240
	14  UIKitCore                           0x00007fff477c9c5a __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 153
	15  UIKitCore                           0x00007fff47cd2d02 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 84
	16  UIKitCore                           0x00007fff477c9ac8 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 381
	17  UIKitCore                           0x00007fff476206e7 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 657
	18  UIKitCore                           0x00007fff4761f26c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248
	19  UIKitCore                           0x00007fff47620411 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 210
	20  UIKitCore                           0x00007fff4808f599 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 535
	21  UIKitCore                           0x00007fff47bfa7f5 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
	22  FrontBoardServices                  0x00007fff365d6165 -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 442
	23  FrontBoardServices                  0x00007fff365fc4d8 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102
	24  FrontBoardServices                  0x00007fff365e0c45 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220
	25  FrontBoardServices                  0x00007fff365fc169 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355
	26  libdispatch.dylib                   0x00007fff5223f7b9 _dispatch_client_callout + 8
	27  libdispatch.dylib                   0x00007fff522421d1 _dispatch_block_invoke_direct + 285
	28  FrontBoardServices                  0x00007fff3662237e __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
	29  FrontBoardServices                  0x00007fff3662206c -[FBSSerialQueue _queue_performNextIfPossible] + 441
	30  FrontBoardServices                  0x00007fff3662257b -[FBSSerialQueue _performNextFromRunLoopSource] + 22
	31  CoreFoundation                      0x00007fff23bd4471 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	32  CoreFoundation                      0x00007fff23bd439c __CFRunLoopDoSource0 + 76
	33  CoreFoundation                      0x00007fff23bd3b74 __CFRunLoopDoSources0 + 180
	34  CoreFoundation                      0x00007fff23bce87f __CFRunLoopRun + 1263
	35  CoreFoundation                      0x00007fff23bce066 CFRunLoopRunSpecific + 438
	36  GraphicsServices                    0x00007fff384c0bb0 GSEventRunModal + 65
	37  UIKitCore                           0x00007fff48092d4d UIApplicationMain + 1621
	38  ???                                 0x0000000106e128ea 0x0 + 4410386666
	39  ???                                 0x0000000106ca5a73 0x0 + 4408892019
	40  ???                                 0x0000000105c97c03 0x0 + 4392057859
	41  NewApp.iOS                          0x00000001004530c1 mono_jit_runtime_invoke + 1569
	42  NewApp.iOS                          0x0000000100568ec8 mono_runtime_invoke_checked + 136
	43  NewApp.iOS                          0x000000010056e4b5 mono_runtime_exec_main_checked + 117
	44  NewApp.iOS                          0x00000001003bf2ec mono_jit_exec + 364
	45  NewApp.iOS                          0x0000000100675f8e xamarin_main + 2702
	46  NewApp.iOS                          0x0000000100396557 main + 71
	47  libdyld.dylib                       0x00007fff5227ec25 start + 1
	48  ???                                 0x0000000000000003 0x0 + 3

  Source=Xamarin.iOS
  StackTrace:
  at ObjCRuntime.Runtime.ThrowNSException (System.IntPtr ns_exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.17/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:406 
  at ObjCRuntime.Runtime.throw_ns_exception (System.IntPtr exc) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/runtime/Delegates.generated.cs:128 
  at (wrapper native-to-managed) ObjCRuntime.Runtime.throw_ns_exception(intptr)
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.17/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.14.1.17/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at NewApp.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\bruno\Desktop\MobileBlazorBindings-master\templates\MobileBlazorBindings-app\NewApp.iOS\Main.cs:17 
@Eilon Eilon reopened this Jan 24, 2020
@Eilon

This comment has been minimized.

Copy link
Collaborator

@Eilon Eilon commented Jan 24, 2020

Re-opening so I can take a look. I wonder if this is because some async work is kicked off for Blazor to start doing its thing. Unfortunately constructors can't be async, so I'll give to give this some thought.

@chrisevans9629

This comment has been minimized.

Copy link

@chrisevans9629 chrisevans9629 commented Jan 24, 2020

@Eilon this error can be reproduced in a xamarin forms app by not setting the main page before the app launches. One possible solution is to have a default page set, and then let blazor swap the page out once it's finished. Or perhaps another option could be to run the blazor startup synchronously if that's possible. Either way, iOS requires their to be page before it can start up.

@Eilon

This comment has been minimized.

Copy link
Collaborator

@Eilon Eilon commented Jan 24, 2020

@chrisevans9629 yes that makes sense thank you for the explanation. I've thought of having a temporary page but that seems a bit icky to me. Running the startup synchronously seems interesting so I'll try just waiting for the async task to complete. I'm not sure if that can deadlock, though. Worth a shot, anyway.

@Alienroid

This comment has been minimized.

Copy link

@Alienroid Alienroid commented Feb 4, 2020

Going forward, are you going to have a monthly preview release? or should we just pull from this repo?

@Eilon

This comment has been minimized.

Copy link
Collaborator

@Eilon Eilon commented Feb 4, 2020

Hopefully at least monthly! We'll do an update very soon - looking like early next week. Also working on getting a NuGet feed up with nightly builds so you don't have to build yourself (which is annoying, I know).

@Alienroid

This comment has been minimized.

Copy link

@Alienroid Alienroid commented Feb 4, 2020

Thanks, I'll wait for your new build. I just copied #76 and I still get System.PlatformNotSupportedException: Operation is not supported on this platform. Probably doing something wrong. Will check out next release. Thanks again.

@Eilon

This comment has been minimized.

Copy link
Collaborator

@Eilon Eilon commented Feb 4, 2020

Ah to fix the iOS crash there are two parts:

  1. Use different Generic Host options: #51
  2. Fix MainPage initialization: #76

For each of these you can just copy the necessary code into your project without needing any updates from the NuGet packages.

@Alienroid

This comment has been minimized.

Copy link

@Alienroid Alienroid commented Feb 4, 2020

Thanks! I tried it and it works. Thank you!

@Eilon

This comment has been minimized.

Copy link
Collaborator

@Eilon Eilon commented Feb 4, 2020

Awesome, thanks for trying it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

7 participants
You can’t perform that action at this time.