I have ran into a weird problem with the AVPlayer. I am using the AVplayer to play videos downloaded in my application. The code below is how I setup the AVPlayer.
var filePath = new NSString("file://" + filePathOnDisk);
var fileUrl = new NSUrl(filePath);
_asset = AVAsset.FromUrl(fileUrl);
_playerItem = new AVPlayerItem(_asset);
_player = new AVPlayer(_playerItem);
_playerStateObserver = _player.AddObserver("status", NSKeyValueObservingOptions.New, PlayerReadyObserver);
_playerLayer = AVPlayerLayer.FromPlayer(_player);
_playerLayer.Frame = Frame;
Layer.AddSublayer(_playerLayer);
When I add an observer like in line 6 above the observer works fine and calls the Action I assigned to it. The problem is when I try to pause the AVPlayer. It causes a crash in the Mono runtime which cannot be caught with try/catch in C#.
I have confirmed that if I do not add the observer I can pause the AVPlayer without any crashes, but then I don't know how to listen for when the player is ready to play.
Adding an observer returns a IDisposable which I do have a reference too. If I dispose that variable before calling Pause then there is no crash. Can anyone please explain why this would be happening. Below is the crash log that I get when this crash occurs.
Any insight would be appreciated.
Thank you.
Callstack below
2017-07-12 14:36:52.789 Educor.Mobile.Ios[8803:411224] critical: Stacktrace:
2017-07-12 14:36:52.789 Educor.Mobile.Ios[8803:411224] critical: at <unknown> <0xffffffff>
2017-07-12 14:36:52.790 Educor.Mobile.Ios[8803:411224] critical: at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend (intptr,intptr) [0x0000a] in <58a9bd8a3cbb4d0092bc0a767ff66c0f>:0
2017-07-12 14:36:52.790 Educor.Mobile.Ios[8803:411224] critical: at AVFoundation.AVPlayer.Pause () [0x00003] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/build/ios/native/AVFoundation/AVPlayer.g.cs:196
2017-07-12 14:36:52.790 Educor.Mobile.Ios[8803:411224] critical: at Educor.Mobile.Ios.CustomViews.BindableViews.BindableNativeVideoPlayer.TogglePlayState () [0x0000d] in /Users/danemackier/MyFiles/Work/Clients/Educor/MoodleApp/MoodleSrc/Educor.Mobile.Ios/CustomViews/BindableViews/BindableNativeVideoPlayer.cs:71
2017-07-12 14:36:52.790 Educor.Mobile.Ios[8803:411224] critical: at Educor.Mobile.Ios.Views.NativeVideoPlayer.NativeVideoPlayerView.<HandlePlayPauseUi>b__8_0 () [0x00001] in /Users/danemackier/MyFiles/Work/Clients/Educor/MoodleApp/MoodleSrc/Educor.Mobile.Ios/Views/NativeVideoPlayer/NativeVideoPlayerView.cs:68
2017-07-12 14:36:52.790 Educor.Mobile.Ios[8803:411224] critical: at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/Foundation/NSAction.cs:163
2017-07-12 14:36:52.791 Educor.Mobile.Ios[8803:411224] critical: at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <2f4074c3120b4d80802e10af84b67d41>:0
2017-07-12 14:36:52.791 Educor.Mobile.Ios[8803:411224] critical: at <unknown> <0xffffffff>
2017-07-12 14:36:52.791 Educor.Mobile.Ios[8803:411224] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) [0x0005c] in <58a9bd8a3cbb4d0092bc0a767ff66c0f>:0
2017-07-12 14:36:52.791 Educor.Mobile.Ios[8803:411224] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIApplication.cs:79
2017-07-12 14:36:52.791 Educor.Mobile.Ios[8803:411224] critical: at UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIApplication.cs:63
2017-07-12 14:36:52.791 Educor.Mobile.Ios[8803:411224] critical: at Educor.Mobile.Ios.Application.Main (string[]) [0x00001] in /Users/danemackier/MyFiles/Work/Clients/Educor/MoodleApp/MoodleSrc/Educor.Mobile.Ios/Main.cs:12
2017-07-12 14:36:52.792 Educor.Mobile.Ios[8803:411224] critical: at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x00051] in <075daed4d09344098906c84c2a5b9b38>:0
2017-07-12 14:36:52.792 Educor.Mobile.Ios[8803:411224] critical:
Native stacktrace:
2017-07-12 14:36:52.802 Educor.Mobile.Ios[8803:411224] critical: 0 libmonosgen-2.0.dylib 0x00000001054030f1 mono_handle_native_crash + 257
2017-07-12 14:36:52.802 Educor.Mobile.Ios[8803:411224] critical: 1 libmonosgen-2.0.dylib 0x000000010535e090 mono_sigsegv_signal_handler + 288
2017-07-12 14:36:52.802 Educor.Mobile.Ios[8803:411224] critical: 2 libsystem_platform.dylib 0x0000000109b3cbba _sigtramp + 26
2017-07-12 14:36:52.802 Educor.Mobile.Ios[8803:411224] critical: 3 libmonosgen-2.0.dylib 0x0000000105707428 mono_defaults + 0
2017-07-12 14:36:52.803 Educor.Mobile.Ios[8803:411224] critical: 4 AVFoundation 0x00000001025def4d -[AVPlayer willChangeValueForKey:] + 86
2017-07-12 14:36:52.803 Educor.Mobile.Ios[8803:411224] critical: 5 AVFoundation 0x00000001025e5615 -[AVPlayer setRate:withVolumeRampDuration:playImmediately:] + 90
2017-07-12 14:36:52.803 Educor.Mobile.Ios[8803:411224] critical: 6 AVFoundation 0x00000001025e598a -[AVPlayer setRate:] + 79
2017-07-12 14:36:52.803 Educor.Mobile.Ios[8803:411224] critical: 7 libxamarin-debug.dylib 0x0000000105853a59 xamarin_dyn_objc_msgSend + 217
2017-07-12 14:36:52.803 Educor.Mobile.Ios[8803:411224] critical: 8 ??? 0x000000011545587e 0x0 + 4651833470
2017-07-12 14:36:52.804 Educor.Mobile.Ios[8803:411224] critical: 9 ??? 0x000000011674d85e 0x0 + 4671723614
2017-07-12 14:36:52.804 Educor.Mobile.Ios[8803:411224] critical: 10 ??? 0x00000001147f5584 0x0 + 4638856580
2017-07-12 14:36:52.804 Educor.Mobile.Ios[8803:411224] critical: 11 libmonosgen-2.0.dylib 0x0000000105361045 mono_jit_runtime_invoke + 1301
2017-07-12 14:36:52.804 Educor.Mobile.Ios[8803:411224] critical: 12 libmonosgen-2.0.dylib 0x000000010553cbf8 do_runtime_invoke + 88
2017-07-12 14:36:52.804 Educor.Mobile.Ios[8803:411224] critical: 13 libmonosgen-2.0.dylib 0x000000010553cb70 mono_runtime_invoke + 208
2017-07-12 14:36:52.805 Educor.Mobile.Ios[8803:411224] critical: 14 libxamarin-debug.dylib 0x000000010584a2a5 xamarin_invoke_trampoline + 5589
2017-07-12 14:36:52.805 Educor.Mobile.Ios[8803:411224] critical: 15 libxamarin-debug.dylib 0x000000010585250d xamarin_arch_trampoline + 189
2017-07-12 14:36:52.805 Educor.Mobile.Ios[8803:411224] critical: 16 libxamarin-debug.dylib 0x00000001058538d1 xamarin_x86_64_common_trampoline + 110
2017-07-12 14:36:52.805 Educor.Mobile.Ios[8803:411224] critical: 17 Foundation 0x000000010293fe9e __NSThreadPerformPerform + 326
2017-07-12 14:36:52.805 Educor.Mobile.Ios[8803:411224] critical: 18 CoreFoundation 0x0000000104ef9761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
2017-07-12 14:36:52.805 Educor.Mobile.Ios[8803:411224] critical: 19 CoreFoundation 0x0000000104ede98c __CFRunLoopDoSources0 + 556
2017-07-12 14:36:52.806 Educor.Mobile.Ios[8803:411224] critical: 20 CoreFoundation 0x0000000104edde76 __CFRunLoopRun + 918
2017-07-12 14:36:52.806 Educor.Mobile.Ios[8803:411224] critical: 21 CoreFoundation 0x0000000104edd884 CFRunLoopRunSpecific + 420
2017-07-12 14:36:52.806 Educor.Mobile.Ios[8803:411224] critical: 22 GraphicsServices 0x0000000106949a6f GSEventRunModal + 161
2017-07-12 14:36:52.806 Educor.Mobile.Ios[8803:411224] critical: 23 UIKit 0x0000000100d21c68 UIApplicationMain + 159
2017-07-12 14:36:52.806 Educor.Mobile.Ios[8803:411224] critical: 24 ??? 0x0000000114d4a37c 0x0 + 4644447100
2017-07-12 14:36:52.806 Educor.Mobile.Ios[8803:411224] critical: 25 ??? 0x0000000114d49fbd 0x0 + 4644446141
2017-07-12 14:36:52.806 Educor.Mobile.Ios[8803:411224] critical:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
You skipped observer in your function call.
Instead of
_playerStateObserver = _player.AddObserver("status", NSKeyValueObservingOptions.New, PlayerReadyObserver);
Try
_playerStateObserver = _player.AddObserver(yourObserver, "status", NSKeyValueObservingOptions.New, nil);
Related
After upgrading MvvmCross from version 4 to 5.1.1, I get the a TargetInvocationException at my entrypoint (UIApplication.Main(...)). This is the class:
using UIKit;
namespace sample
{
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");
}
}
}
And this is the exception that is thrown:
Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
2017-10-25 11:12:34.931 SampleAppMobileiOS[5351:568000]
Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
at MvvmCross.Platform.Mvx.Resolve[TService] () [0x00006] in <54d9eb77c4d448d4bc5e7c7a5cdd0a97>:0
at MvvmCross.iOS.Views.MvxBindingViewControllerAdapter.HandleViewDidDisappearCalled (System.Object sender, MvvmCross.Platform.Core.MvxValueEventArgs`1[T] e) [0x00029] in C:\projects\mvvmcross\MvvmCross\iOS\iOS\Views\MvxBindingViewControllerAdapter.cs:26
at MvvmCross.iOS.Views.MvxViewControllerAdaptingExtensions.AdaptForBinding (MvvmCross.Platform.iOS.Views.IMvxEventSourceViewController view) [0x00008] in C:\projects\mvvmcross\MvvmCross\iOS\iOS\Views\MvxViewControllerAdaptingExtensions.cs:17
at MvvmCross.iOS.Views.MvxViewController..ctor (System.IntPtr handle) [0x00009] in C:\projects\mvvmcross\MvvmCross\iOS\iOS\Views\MvxViewCon
troller.cs:28
at SampleApp.Mobile.iOS.BaseViewController..ctor (System.IntPtr handle) [0x0008c] in D:\Sample_Mobile\SampleApp.Mobile\SampleApp.Mobile.iOS\Views\BaseViewController.cs:35
at SampleApp.Mobile.iOS.MainView..ctor (System.IntPtr handle) [0x00000] in D:\Sample_Mobile\SampleApp.Mobile\SampleApp.Mobile.iOS\Views\MainView.cs:16
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.93/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:661
--- End of inner exception stack trace ---
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.93/src/mono/mcs/c
lass/corlib/System.Reflection/MonoMethod.cs:667
at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.93/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:652
at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.93/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:680
at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.93/src/mono/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62
at ObjCRuntime.Runtime.ConstructNSObject[T] (System.IntPtr ptr, System.Type type, Ob
jCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x0003e] in <512590c9cb4447d89974aa2a90fea66f>:0
at ObjCRuntime.Runtime.ConstructNSObject (System.IntPtr ptr, System.IntPtr klass, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x00013] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:981
at ObjCRuntime.Runtime.GetNSObject (System.IntPtr ptr, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution, System.Boolean evenInFinalizerQueue) [0x00022] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:1099
at ObjCRuntime.Runtime.TryGetOrConstructNSObjectWrapped (System.IntPtr ptr) [0x00000] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:648
at ObjCRuntime.Runtime.try_get_or_construct_nsobject (System.IntPtr obj, System.Int32& exception_gchandle) [0x00003] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/runtime/Delegates.
generated.cs:342
--- End of stack trace from previous location where exception was thrown ---
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 /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at SampleApp.Mobile.iOS.Application.Main (System.String[] args) [0x00001] in D:\Sample_Mobile\SampleApp.Mobile\SampleApp.Mobile.iOS\Main.cs:12
2017-10-25 11:12:34.938 SampleAppMobileiOS[5351:568000] Unhandled managed exception:
Exception has been thrown by the target of an invocation. (System.Reflection.TargetInvocationException)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.93/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:667
at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.93/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:652
at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Library/Frameworks/Xamarin.iOS.framewor
k/Versions/11.4.0.93/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:680
at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.93/src/mono/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62
at ObjCRuntime.Runtime.ConstructNSObject[T] (System.IntPtr ptr, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x0003e] in <512590c9cb4447d89974aa2a90fea66f>:0
at ObjCRuntime.Runtime.ConstructNSObject (System.IntPtr ptr, System.IntPtr klass, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x00013] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:981
at ObjCRuntime.Runtime.GetNSObject (System.IntPtr ptr, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution, System.Boolean evenInFinalizerQueue) [0x00022] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:1099
at ObjCRuntime.Runtime.TryGetOrConstructNSObjectWrapped (System.IntPtr ptr) [0x00000] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:648
at ObjCRuntime.Runtime.try_get_or_construct_nsobject (System.IntPtr obj, System.Int32& exception_gchandle) [0x00003] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/runtime/Delegates.generated.cs:342
--- End of stack trace from previous location where exception was thrown ---
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 /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5489/1b460cb9/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at Oase
n.DigitaleRotonde.Mobile.iOS.Application.Main (System.String[] args) [0x00001] in D:\Sample_Mobile\SampleApp.Mobile\SampleApp.Mobile.iOS\Main.cs:12
--- inner exception ---
Object reference not set to an instance of an object (System.NullReferenceException)
at MvvmCross.Platform.Mvx.Resolve[TService] () [0x00006] in <54d9eb77c4d448d4bc5e7c7a5cdd0a97>:0
at MvvmCross.iOS.Views.MvxBindingViewControllerAdapter.HandleViewDidDisappearCalled (System.Object sender, MvvmCross.Platform.Core.MvxValueEventArgs`1[T] e) [0x00029] in C:\projects\mvvmcross\MvvmCross\iOS\iOS\Views\MvxBindingViewControllerAdapter.cs:26
at MvvmCross.iOS.Views.MvxViewControllerAdaptingExtensions.AdaptForBinding (MvvmCross.Platform.iOS.Views.IMvxEventSourceViewController view) [0x00008] in C:\projects\mvvmcross\MvvmCross\iOS\iOS\Views\MvxViewControllerAdaptingExtensions.cs:17
at MvvmCross.iOS.Views.MvxViewController..ctor (System.IntPtr handle) [0x00009] in C:\projects\mvvmcross\MvvmCross\iOS\iOS\Views\MvxViewCo
ntroller.cs:28
at SampleApp.Mobile.iOS.BaseViewController..ctor (System.IntPtr handle) [0x0008c] in D:\Sample_Mobile\SampleApp.Mobile\SampleApp.Mobile.iOS\Views\BaseViewController.cs:35
at SampleApp.Mobile.iOS.MainView..ctor (System.IntPtr handle) [0x00000] in D:\Sample_Mobile\SampleApp.Mobile\SampleApp.Mobile.iOS\Views\MainView.cs:16
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.93/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:661
2017-10-25 11:12:34.939 SampleAppMobileiOS[5351:568000] critical: Stacktrace:
2017-10-25 11:12:34.939 SampleAppMobileiOS[5351:568000] critical:
Native stacktrace:
2017-10-25 11:12:34.953 SampleAppMobileiOS[5351:568000] critical: 0 SampleAppMobileiOS 0x0000000101491b2c SampleAppMobileiOS + 21240620
2017-10-25 11:12:34.954 SampleAppMobileiOS[5351:568000] critical: 1 libsystem_platform.dylib 0x0000000189a5531c _sigtramp + 52
2017-10-25 11:12:34.954 SampleAppMobileiOS[5351:568000] critical: 2 libsystem_pthread.dylib 0x0000000189a5b264 pthread_kill + 112
2017-10-25 11:12:34.955 SampleAppMobileiOS[5351:568000] critical: 3 libsystem_c.dylib 0x00000001899059c4 abort + 140
2017-10-25 11:12:34.955 SampleAppMobileiOS[5351:568000] critical: 4 SampleAppMobileiOS 0x00000001015963dc xamarin_get_block_descriptor + 8260
2017-10-25 11:12:34.956 SampleAppMobileiOS[5351:568000] critical: 5 SampleAppMobileiOS 0x00000001014cf4ec mono_pmip + 216852
2017-10-25 11:12:34.956 SampleAppMobileiOS[5351:568000] critical: 6 SampleAppMobileiOS 0x0000000101491928 SampleAppMobileiOS + 21240104
2017-10-25 11:12:34.957 SampleAppMobileiOS[5351:568000] critical: 7 SampleAppMobileiOS 0x0000000101490738 SampleAppMobileiOS + 21235512
2017-10-25 11:12:34.958 SampleAppMobileiOS[5351:568000] critical: 8 SampleAppMobileiOS 0x0000000101488d1c SampleAppMobileiOS + 21204252
2017-10-25 11:12:34.958 SampleAppMobileiOS[5351:568000] critical: 9 SampleAppMobileiOS 0x0000000100364e68 SampleAppMobileiOS + 3231336
2017-10-25 11:12:34.959 SampleAppMobileiOS[5351:568000] critical: 10 SampleAppMobileiOS 0x0000000101596130 xamarin_get_block_descriptor + 7576
2017-10-25 11:12:34.960 SampleAppMobileiOS[5351:568000] critical: 11 SampleAppMobileiOS 0x0000000101595fb0 xamarin_get_block_descriptor + 7192
2017-10-25 11:12:34.960 SampleAppMobileiOS[5351:568000] critical: 12 SampleAppMobileiOS 0x0000000100062400 SampleAppMobileiOS + 74752
2017-10-25 11:12:34.961 SampleAppMobileiOS[5351:568000] critical: 13 SampleAppMobileiOS 0x000000010006220c SampleAppMobileiOS + 74252
2017-10-25 11:12:34.961 SampleAppMobileiOS[5351:568000] critical: 14 Foundation 0x000000018b3ab64c <redacted> + 272
2017-10-25 11:12:34.962 SampleAppMobileiOS[5351:568000] critical: 15 UIKit 0x0000000190e2c2fc <redacted> + 104
2017-10-25 11:12:34.962 SampleAppMobileiOS[5351:568000] critical: 16 UIKit 0x0000000190fd00d8 <redacted> + 124
2017-10-25 11:12:34.963 SampleAppMobileiOS[5351:568000] critical: 17 CoreFoundation 0x000000018a8b7fac <redacted> + 232
2017-10-25 11:12:34.963 SampleAppMobileiOS[5351:568000] critical: 18 UIKit 0x0000000190fceacc <redacted> + 1696
2017-10-25 11:12:34.964 SampleAppMobileiOS[5351:568000] critical: 19 UIKit 0x0000000190e2f2d4 <redacted> + 372
2017-10-25 11:12:34.964 SampleAppMobileiOS[5351:568000] critical: 20 UIKit 0x0000000190bf946c <redacted> + 176
2017-10-25 11:12:34.965 SampleAppMobileiOS[5351:568000] critical: 21 UIKit 0x0000000190ac7b68 <redacted> + 180
2017-10-25 11:12:34.965 SampleAppMobileiOS[5351:568000] critical: 22 UIKit 0x0000000190b7fff0 <redacted> + 72
2017-10-25 11:12:34.966 SampleAppMobileiOS[5351:568000] critical: 23 UIKit 0x0000000190b7fec8 <redacted> + 416
2017-10-25 11:12:34.966 SampleAppMobileiOS[5351:568000] critical: 24 UIKit 0x0000000190b7f1f8 <redacted> + 144
2017-10-25 11:12:34.966 SampleAppMobileiOS[5351:568000] critical: 25 UIKit 0x0000000190b7ec2c <redacted> + 856
2017-10-25 11:12:34.967 SampleAppMobileiOS[5351:568000] critical: 26 UIKit 0x0000000190b7e7e0 <redacted> + 64
2017-10-25 11:12:34.967 SampleAppMobileiOS[5351:568000] critical: 27 UIKit 0x0000000190b7e744 <redacted> + 188
2017-10-25 11:12:34.967 SampleAppMobileiOS[5351:568000] critical: 28 UIKit 0x0000000190ac507c <redacted> + 1200
2017-10-25 11:12:34.968 SampleAppMobileiOS[5351:568000] critical: 29 QuartzCore 0x000000018dcb5274 <redacted> + 148
2017-10-25 11:12:34.968 SampleAppMobileiOS[5351:568000] critical: 30 QuartzCore 0x000000018dca9de8 <redacted> + 292
2017-10-25 11:12:34.968 SampleAppMobileiOS[5351:568000] critical: 31 QuartzCore 0x000000018dca9ca8 <redacted> + 32
2017-10-25 11:12:34.969 SampleAppMobileiOS[5351:568000] critical: 32 QuartzCore 0x000000018dc2534c <redacted> + 252
2017-10-25 11:12:34.969 SampleAppMobileiOS[5351:568000] critical: 33 QuartzCore 0x000000018dc4c3ac <redacted> + 504
2017-10-25 11:12:34.969 SampleAppMobileiOS[5351:568000] critical: 34 QuartzCore 0x000000018dc4ce78 <redacted> + 120
2017-10-25 11:12:34.969 SampleAppMobileiOS[5351:568000] critical: 35 CoreFoundation 0x000000018a9449a8 <redacted> + 32
2017-10-25 11:12:34.970 SampleAppMobileiOS[5351:568000] critical: 36 CoreFoundation 0x000000018a942630 <redacted> + 372
2017-10-25 11:12:34.970 SampleAppMobileiOS[5351:568000] critical: 37 CoreFoundation 0x000000018a872dc4 CFRunLoopRunSpecific + 456
2017-10-25 11:12:34.970 SampleAppMobileiOS[5351:568000] critical: 38 UIKit 0x0000000190b32384 <redacted> + 652
2017-10-25 11:12:34.971 SampleAppMobileiOS[5351:568000] critical: 39 UIKit 0x0000000190b2d058 UIApplicationMain + 208
2017-10-25 11:12:34.971 SampleAppMobileiOS[5351:568000] critical: 40 SampleAppMobileiOS 0x00000001004552b0 SampleAppMobileiOS + 4215472
2017-10-25 11:12:34.971 SampleAppMobileiOS[5351:568000] critical: 41 SampleAppMobileiOS 0x00000001003fbbdc SampleAppMobileiOS + 3849180
2017-10-25 11:12:34.972 SampleAppMobileiOS[5351:568000] critical: 42 SampleAppMobileiOS 0x00000001003fbb9c SampleAppMobileiOS + 3849116
2017-10-25 11:12:34.972 SampleAppMobileiOS[5351:568000] critical: 43 SampleAppMobileiOS 0x0000000100082d10 SampleAppMobileiOS + 208144
2017-10-25 11:12:34.972 SampleAppMobileiOS[5351:568000] critical: 44 SampleAppMobileiOS 0x0000000100334384 SampleAppMobileiOS + 3031940
2017-10-25 11:12:34.973 SampleAppMobileiOS[5351:568000] critical: 45 SampleAppMobileiOS 0x000000010149fc44 mono_pmip + 22124
2017-10-25 11:12:34.973 SampleAppMobileiOS[5351:568000] critical: 46 SampleAppMobileiOS 0x0000000101507454 mono_pmip + 446076
2017-10-25 11:12:34.973 SampleAppMobileiOS[5351:568000] critical: 47 SampleAppMobileiOS 0x0000000101509fc4 mono_pmip + 457196
2017-10-25 11:12:34.974 SampleAppMobileiOS[5351:568000] critical: 48 SampleAppMobileiOS 0x00000001014884fc SampleAppMobileiOS + 21202172
2017-10-25 11:12:34.974 SampleAppMobileiOS[5351:568000] critical: 49 SampleAppMobileiOS 0x00000001015a4074 _Z9__isctypeim + 46228
2017-10-25 11:12:34.974 SampleAppMobileiOS[5351:568000] critical: 50 SampleAppMobileiOS 0x000000010007611c SampleAppMobileiOS + 155932
2017-10-25 11:12:34.975 SampleAppMobileiOS[5351:568000] critical: 51 libdyld.dylib 0x000000018988159c <redacted> + 4
2017-10-25 11:12:34.975 SampleAppMobileiOS[5351:568000] critical:
=================================================================
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.
=================================================================
The app has been terminated.
Failed to Stop app: An error occured on client IDB471022 while executing a reply for topic xvs/idb/4.7.10.22/stop-app
The app has been terminated.
The app works fine on mvvmcross 4, and the migration guide shows no surprises: https://www.mvvmcross.com/documentation/upgrading/upgrade-to-mvvmcross-50. I can't seem to debug anything. The only breakpoint that triggers is on UIApplication.Main, and step-into stops quite quickly and results in the given exception. Where do I start searching in order to fix this?
[edit]
This is still an issue, even with MVVMCross 5.7. It tries to instantiate a MainView class, which extends from MvxViewController. This happens before there is any code executed from my Setup class.
Looking at the line 26 that fails in MvxBindingViewControllerAdapter:
IosView.BindingContext = Mvx.Resolve<IMvxBindingContext>();
Where IosView is the ViewController cast to IMvxIosView. This suggests that your ViewController does not implement IMvxIosView. Since it seems like it is the only thing that would be null in this case.
I finally found the answer. I had 2 major versions of MvvmCross included in the project. I've now upgraded everything to 6.x.x. and the application starts up.
On occassion, my Xamarin.iOS throws a SIGSEGV error when stopping audio.
2016-08-30 11:34:28.400 MyAppiOS[285:23021] critical: Stacktrace:
2016-08-30 11:34:28.400 MyAppiOS[285:23021] critical: at <unknown> <0xffffffff>
2016-08-30 11:34:28.401 MyAppiOS[285:23021] critical: at (wrapper managed-to-native) System.Runtime.InteropServices.GCHandle.CheckCurrentDomain (int) <0x0003f>
2016-08-30 11:34:28.401 MyAppiOS[285:23021] critical: at System.Runtime.InteropServices.GCHandle.op_Explicit (intptr) [0x0001b] in /Users/builder/data/lanes/3539/f37444ae/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs:124
2016-08-30 11:34:28.402 MyAppiOS[285:23021] critical: at System.Runtime.InteropServices.GCHandle.FromIntPtr (intptr) [0x00000] in /Users/builder/data/lanes/3539/f37444ae/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs:166
2016-08-30 11:34:28.403 MyAppiOS[285:23021] critical: at AudioToolbox.SystemSound.SoundCompletionShared (AudioToolbox.SystemSoundId,intptr) <0x0002b>
2016-08-30 11:34:28.403 MyAppiOS[285:23021] critical: at (wrapper native-to-managed) AudioToolbox.SystemSound.SoundCompletionShared (AudioToolbox.SystemSoundId,intptr) <0x0004f>
2016-08-30 11:34:28.403 MyAppiOS[285:23021] critical: at <unknown> <0xffffffff>
2016-08-30 11:34:28.404 MyAppiOS[285:23021] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x0004f>
2016-08-30 11:34:28.404 MyAppiOS[285:23021] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Users/builder/data/lanes/3539/f37444ae/source/maccore/src/UIKit/UIApplication.cs:79
2016-08-30 11:34:28.404 MyAppiOS[285:23021] critical: at UIKit.UIApplication.Main (string[],string,string) [0x0001c] in /Users/builder/data/lanes/3539/f37444ae/source/maccore/src/UIKit/UIApplication.cs:62
2016-08-30 11:34:28.404 MyAppiOS[285:23021] critical: at MyApp.iOS.Application.Main (string[]) [0x00001] in C:\Dev\securecom\Mobile\MyApp\trunk\MyApp.iOS\Main.cs:26
2016-08-30 11:34:28.405 MyAppiOS[285:23021] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0x000ff>
2016-08-30 11:34:28.407 MyAppiOS[285:23021] critical:
Native stacktrace:
2016-08-30 11:34:28.507 MyAppiOS[285:23021] critical: 0 MyAppiOS 0x00093a91 mono_handle_native_sigsegv + 242
2016-08-30 11:34:28.507 MyAppiOS[285:23021] critical: 1 MyAppiOS 0x0009afeb mono_sigsegv_signal_handler + 222
2016-08-30 11:34:28.508 MyAppiOS[285:23021] critical: 2 libsystem_platform.dylib 0x242d585f _sigtramp + 42
2016-08-30 11:34:28.508 MyAppiOS[285:23021] critical: 3 ??? 0x0000000a 0x0 + 10
2016-08-30 11:34:28.508 MyAppiOS[285:23021] critical: 4 MyAppiOS 0x000bfb0b mono_gc_GCHandle_CheckCurrentDomain + 18
2016-08-30 11:34:28.508 MyAppiOS[285:23021] critical: 5 MyAppiOS 0x004fa414 wrapper_managed_to_native_System_Runtime_InteropServices_GCHandle_CheckCurrentDomain_int + 72
2016-08-30 11:34:28.508 MyAppiOS[285:23021] critical: 6 MyAppiOS 0x004fa34c System_Runtime_InteropServices_GCHandle_op_Explicit_intptr + 72
2016-08-30 11:34:28.509 MyAppiOS[285:23021] critical: 7 MyAppiOS 0
x004fa82c System_Runtime_InteropServices_GCHandle_FromIntPtr_intptr + 36
2016-08-30 11:34:28.509 MyAppiOS[285:23021] critical: 8 MyAppiOS 0x00642e84 AudioToolbox_SystemSound_SoundCompletionShared_AudioToolbox_SystemSoundId_intptr + 44
2016-08-30 11:34:28.509 MyAppiOS[285:23021] critical: 9 MyAppiOS 0x006948ec wrapper_native_to_managed_AudioToolbox_SystemSound_SoundCompletionShared_AudioToolbox_SystemSoundId_intptr + 80
2016-08-30 11:34:28.510 MyAppiOS[285:23021] critical: 10 CoreFoundation 0x24567909 <redacted> + 12
2016-08-30 11:34:28.511 MyAppiOS[285:23021] critical: 11 CoreFoundation 0x245673c5 <redacted> + 216
2016-08-30 11:34:28.511 MyAppiOS[285:23021] critical: 12 CoreFoundation 0x2456594b <redacted> + 818
2016-08-30 11:34:28.511 MyAppiOS[285:23021] critical: 13 CoreFoundation 0x244b41c9 CFRunLoopRunSpecific + 516
2016-08-30 11:34:28.512 MyAppiOS[285:23021] critical: 14 CoreFoundation 0x244b3fbd CFRunLoopRunInMode + 108
2016-08-30 11:34:28.512 MyAppiOS[285:23021] critical: 15 GraphicsServices 0x25ad0af9 GSEventRunModal + 160
2016-08-30 11:34:28.512 MyAppiOS[285:23021] critical: 16 UIKit 0x28bed435 UIApplicationMain + 144
2016-08-30 11:34:28.512 MyAppiOS[285:23021] critical: 17 MyAppiOS 0x00682310 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 252
2016-08-30 11:34:28.512 MyAppiOS[285:23021] critical: 18 MyAppiOS 0x005fabe0 UIKit_UIApplication_Main_string___intptr_intptr + 52
2016-08-30 11:34:28.513 MyAppiOS[285:23021] critical: 19 MyAppiOS 0x005faba0 UIKit_UIApplication_Main_string___string_string + 204
2016-08-30 11:34:28.513 MyAppiOS[285:23021] critical: 20 MyAppiOS 0x0016d92c MyApp_iOS_Application_Main_string__ + 160
2016-08-30 11:34:28.513 MyAppiOS[285:23021] critical: 21 MyAppiOS 0x00593dc4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr +
ime or one of the native libraries
used by your application.
=================================================================
256
2016-08-30 11:34:28.514 MyAppiOS[285:23021] critical: 22 MyAppiOS 0x0009ca19 mono_jit_runtime_invoke + 1588
2016-08-30 11:34:28.514 MyAppiOS[285:23021] critical: 23 MyAppiOS 0x000e141f mono_runtime_invoke + 102
2016-08-30 11:34:28.514 MyAppiOS[285:23021] critical: 24 MyAppiOS 0x000e49fb mono_runtime_exec_main + 284
2016-08-30 11:34:28.514 MyAppiOS[285:23021] critical: 25 MyAppiOS 0x0015939c xamarin_main + 2232
2016-08-30 11:34:28.514 MyAppiOS[285:23021] critical: 26 MyAppiOS 0x00c09669 main + 112
2016-08-30 11:34:28.514 MyAppiOS[285:23021] critical: 27 libdyld.dylib 0x24160873 <redacted> + 2
2016-08-30 11:34:28.515 MyAppiOS[285:23021] critical:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runt
Any help preventing this error from being thrown? I've tried putting the code that stops the audio into a try-catch but it still crashes the app.
I have an array of SystemSounds that when I exit the ViewController I want to stop playing all of the sounds. If a sound is currently playing then the code executes fine. It appears to throw the above error when one sound is completed and the next hasn't started. My code for stopping the audio is:
try
{
if (_tracks != null) // an array of tracks that have to be played
{
for (int i = _soundQueue - 1; i >= 0; i--) // _soundQueue is the num of tra
{
_tracks[i].Item1.RemoveSystemSoundCompletion();
_tracks[i].Item1.Close();
}
}
_soundQueue = 0;
_tracks = null;
_playingAudio = false;
}
catch (Exception ex)
{
}
I am trying to use the camera in a Xamarin iOS app.
First step seems to check if the app has access to the camera. But i get a fatal error in the mono runtime while doing this. Any idea?
Here are more details about the exception:
In Visual Studio (2015), I create a new "Blank App (iPhone)" project.
Since I own a iPhone 3GS, I switch to armv7 in the project properties, and select iOS 6.1 as deployment target.
Build app, debug on iPhone: the mac agent works well, and the empty app starts on my phone.
Then I go to AppDelegate.FinishedLaunching(...) and add
AVCaptureDevice.GetAuthorizationStatus(AVMediaType.Video);
before returning true.
Rebuild app, debug... and an exception is being thrown by GetAuthorizationStatus(...). Here is its stacktrace:
2016-06-24 12:50:22.691 App2[491:907] +[AVCaptureDevice authorizationStatusForMediaType:]: unrecognized selector sent to class 0x3a49c070
2016-06-24 12:50:22.704 App2[491:907] critical: Stacktrace:
2016-06-24 12:50:22.708 App2[491:907] critical: at <0xffffffff>
2016-06-24 12:50:22.712 App2[491:907] critical: at <0xffffffff>
2016-06-24 12:50:22.715 App2[491:907] critical:
Native stacktrace:
2016-06-24 12:50:22.964 App2[491:907] critical: 0 App2 0x0004f49d mono_handle_native_sigsegv + 240
2016-06-24 12:50:22.968 App2[491:907] critical: 1 App2 0x00056a23 mono_sigsegv_signal_handler + 222
2016-06-24 12:50:22.971 App2[491:907] critical: 2 libsystem_c.dylib 0x3a37ee93 _sigtramp + 42
2016-06-24 12:50:22.975 App2[491:907] critical: 3 App2 0x0033d3d0 map_dwarf_reg_to_hw_reg + 0
2016-06-24 12:50:22.978 App2[491:907] critical: 4 App2 0x0004ed4f mono_handle_exception_internal + 1508
2016-06-24 12:50:22.982 App2[491:907] critical: 5 App2 0x0004e767 mono_handle_exception + 30
2016-06-24 12:50:22.985 App2[491:907] critical: 6 App2 0x0004819b mono_arm_throw_exception + 106
2016-06-24 12:50:22.989 App2[491:907] critical: 7 App2 0x00244194 throw_exception + 64
2016-06-24 12:50:22.996 App2[491:907] critical: 8 App2 0x00274c74 ObjCRuntime_Runtime_throw_ns_exception_intptr + 28
2016-06-24 12:50:23.000 App2[491:907] critical: 9 App2 0x002ab490 wrapper_native_to_managed_ObjCRuntime_Runtime_throw_ns_exception_intptr + 72
2016-06-24 12:50:23.004 App2[491:907] critical: 10 App2 0x000f1bac xamarin_throw_ns_exception + 52
2016-06-24 12:50:23.007 App2[491:907] critical: 11 App2 0x000f3a64 _ZL17exception_handlerP11NSException + 224
2016-06-24 12:50:23.011 App2[491:907] critical: 12 CoreFoundation 0x322a457f + 614
2016-06-24 12:50:23.014 App2[491:907] critical: 13 libobjc.A.dylib 0x39f00a65 + 128
2016-06-24 12:50:23.018 App2[491:907] critical: 14 libc++abi.dylib 0x3994d07b + 78
2016-06-24 12:50:23.025 App2[491:907] critical: 15 libc++abi.dylib 0x3994d114 + 19
2016-06-24 12:50:23.029 App2[491:907] critical: 16 libc++abi.dylib 0x3994e599 cxa_current_exception_type + 0
2016-06-24 12:50:23.032 App2[491:907] critical: 17 libobjc.A.dylib 0x39f009d1 objc_exception_rethrow + 12
2016-06-24 12:50:23.036 App2[491:907] critical: 18 CoreFoundation 0x321eaf21 CFRunLoopRunSpecific + 456
2016-06-24 12:50:23.039 App2[491:907] critical: 19 CoreFoundation 0x321ead49 CFRunLoopRunInMode + 104
2016-06-24 12:50:23.043 App2[491:907] critical: 20 UIKit 0x34103485 + 668
2016-06-24 12:50:23.046 App2[491:907] critical: 21 UIKit 0x34100301 UIApplicationMain + 1120
2016-06-24 12:50:23.054 App2[491:907] critical: 22 App2 0x002a6fec wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 252
2016-06-24 12:50:23.057 App2[491:907] critical: 23 App2 0x0026f8a4 UIKit_UIApplication_Main_string___intptr_intptr + 52
2016-06-24 12:50:23.064 App2[491:907] critical: 24 App2 0x0026f864 UIKit_UIApplication_Main_string___string_string + 204
2016-06-24 12:50:23.069 App2[491:907] critical: 25 App2 0x0010a8e8 App2_Application_Main_string + 152
2016-06-24 12:50:23.073 App2[491:907] critical: 26 App2 0x00223870 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 256
2016-06-24 12:50:23.078 App2[491:907] critical: 27 App2 0x0005842b mono_jit_runtime_invoke + 1562
2016-06-24 12:50:23.083 App2[491:907] critical: 28 App2 0x000991e7 mono_runtime_invoke + 102
2016-06-24 12:50:23.087 App2[491:907] critical: 29 App2 0x0009c799 mono_runtime_exec_main + 284
2016-06-24 12:50:23.092 App2[491:907] critical: 30 App2 0x0010a4c0 xamarin_main + 2232
2016-06-24 12:50:23.096 App2[491:907] critical: 31 App2 0x002b6d6d main + 112
2016-06-24 12:50:23.101 App2[491:907] critical: 32 libdyld.dylib 0x3a337b20 + 0
2016-06-24 12:50:23.106 App2[491:907] critical: Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
+[AVCaptureDevice authorizationStatusForMediaType:]: unrecognized selector sent to class 0x3a49c070
What is the version of iOS running on your device ?
select iOS 6.1 as deployment target.
Because if it's 6.1, like your deployment target, then you cannot call this API since it was added in iOS 7.0.
You need to conditionally call this on iOS 7.0+, e.g.
if (UIDevice.CurrentDevice.CheckSystemVersion (7,0)) {
AVCaptureDevice.GetAuthorizationStatus (AVMediaType.Video);
}
The assembly browser can show you, with attributes, the minimum version required for the API.
I have a controller with an ImagePicker. When the image is selected on the Simulator, everything works fine, when it runs on the device I get an horrible crash!
If I try to debug, the debugger does not stop inside the method, if I wrote something to log inside the method, it's not logged.
This is my picker code:
imagePicker = new UIImagePickerController ();
imagePicker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
imagePicker.MediaTypes = UIImagePickerController.AvailableMediaTypes (UIImagePickerControllerSourceType.PhotoLibrary);
imagePicker.FinishedPickingMedia += ImagePicker_FinishedPickingMedia;
imagePicker.Canceled += (sender, e) => { imagePicker.DismissModalViewController (true);};
profPic.UserInteractionEnabled = true;
profPic.AddGestureRecognizer(new UITapGestureRecognizer(()=>
{
NavigationController.ShowViewController(imagePicker, this);
}));
This is the exception:
2015-11-26 17:54:41.933 FairbooksIOS[204:5289] critical: Stacktrace:
2015-11-26 17:54:41.934 FairbooksIOS[204:5289] critical: at <unknown> <0xffffffff>
2015-11-26 17:54:41.934 FairbooksIOS[204:5289] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
2015-11-26 17:54:41.935 FairbooksIOS[204:5289] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/src/UIKit/UIApplication.cs:77
2015-11-26 17:54:41.935 FairbooksIOS[204:5289] critical: at UIKit.UIApplication.Main (string[],string,string) [0x0001c] in /Users/builder/data/lanes/2320/1f068b49/source/maccore/src/UIKit/UIApplication.cs:60
2015-11-26 17:54:41.936 FairbooksIOS[204:5289] critical: at Fairbooks.IOS.Application.Main (string[]) [0x00009] in /Users/ziba/git/Fairbooks.IOS/Main.cs:19
2015-11-26 17:54:41.936 FairbooksIOS[204:5289] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
2015-11-26 17:54:41.936 FairbooksIOS[204:5289] critical:
Native stacktrace:
2015-11-26 17:54:42.090 FairbooksIOS[204:5289] critical: 0 FairbooksIOS 0x0000000100cf9278 mono_handle_native_sigsegv + 260
2015-11-26 17:54:42.090 FairbooksIOS[204:5289] critical: 1 FairbooksIOS 0x0000000100d061c4 mono_sigsegv_signal_handler + 328
2015-11-26 17:54:42.091 FairbooksIOS[204:5289] critical: 2 libsystem_platform.dylib 0x000000019a2bd94c _sigtramp + 68
2015-11-26 17:54:42.091 FairbooksIOS[204:5289] critical: 3 FairbooksIOS 0x0000000100de9c24 _ZL16get_raw_gchandleP11objc_object + 44
2015-11-26 17:54:42.091 FairbooksIOS[204:5289] critical: 4 FairbooksIOS 0x0000000100de9bc4 _ZL12get_gchandleP11objc_object + 24
2015-11-26 17:54:42.092 FairbooksIOS[204:5289] critical: 5 FairbooksIOS 0x0000000100de9834 xamarin_get_gchandle + 24
2015-11-26 17:54:42.092 FairbooksIOS[204:5289] critical: 6 FairbooksIOS 0x0000000100de9788 xamarin_get_nsobject_with_type_for_ptr_created + 100
2015-11-26 17:54:42.092 FairbooksIOS[204:5289] critical: 7 FairbooksIOS 0x0000000100df38cc xamarin_trampoline + 4144
2015-11-26 17:54:42.092 FairbooksIOS[204:5289] critical: 8 UIKit 0x000000018a77ef70 <redacted> + 168
2015-11-26 17:54:42.093 FairbooksIOS[204:5289] critical: 9 PhotoLibrary 0x0000000192804ffc PLNotifyImagePickerOfImageAvailability + 80
2015-11-26 17:54:42.093 FairbooksIOS[204:5289] critical: 10 PhotosUI 0x00000001897ec5f4 <redacted> + 168
2015-11-26 17:54:42.093 FairbooksIOS[204:5289] critical: 11 PhotosUI 0x00000001897ec37c <redacted> + 44
2015-11-26 17:54:42.094 FairbooksIOS[204:5289] critical: 12 PhotosUI 0x0000000189914ca4 <redacted> + 308
2015-11-26 17:54:42.094 FairbooksIOS[204:5289] critical: 13 PhotosUI 0x0000000189914680 <redacted> + 96
2015-11-26 17:54:42.094 FairbooksIOS[204:5289] critical: 14 libdispatch.dylib 0x000000019a0a16e8 <redacted> + 24
2015-11-26 17:54:42.094 FairbooksIOS[204:5289] critical: 15 libdispatch.dylib 0x000000019a0a16a8 <redacted> + 16
2015-11-26 17:54:42.095 FairbooksIOS[204:5289] critical: 16 libdispatch.dylib 0x000000019a0a6db0 _dispatch_main_queue_callback_4CF + 1844
2015-11-26 17:54:42.095 FairbooksIOS[204:5289] critical: 17 CoreFoundation 0x0000000184cf81f8 <redacted> + 12
2015-11-26 17:54:42.095 FairbooksIOS[204:5289] critical: 18 CoreFoundation 0x0000000184cf6060 <redacted> + 1628
2015-11-26 17:54:42.095 FairbooksIOS[204:5289] critical: 19 CoreFoundation 0x0000000184c24ca0 CFRunLoopRunSpecific + 384
2015-11-26 17:54:42.095 FairbooksIOS[204:5289] critical: 20 GraphicsServices 0x000000018fc8c088 GSEventRunModal + 180
2015-11-26 17:54:42.096 FairbooksIOS[204:5289] critical: 21 UIKit 0x000000018a33cffc UIApplicationMain + 204
2015-11-26 17:54:42.096 FairbooksIOS[204:5289] critical: 22 FairbooksIOS 0x000000010029c94c wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 348
2015-11-26 17:54:42.096 FairbooksIOS[204:5289] critical: 23 FairbooksIOS 0x000000010021f1fc UIKit_UIApplication_Main_string___intptr_intptr + 44
2015-11-26 17:54:42.096 FairbooksIOS[204:5289] critical: 24 FairbooksIOS 0x000000010021f1bc UIKit_UIApplication_Main_string___string_string + 172
2015-11-26 17:54:42.096 FairbooksIOS[204:5289] critical: 25 FairbooksIOS 0x00000001000d1278 Fairbooks_IOS_Application_Main_string__ + 184
2015-11-26 17:54:42.097 FairbooksIOS[204:5289] critical: 26 FairbooksIOS 0x00000001004a89c4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
2015-11-26 17:54:42.097 FairbooksIOS[204:5289] critical: 27 FairbooksIOS 0x0000000100d084a4 mono_jit_runtime_invoke + 1264
2015-11-26 17:54:42.097 FairbooksIOS[204:5289] critical: 28 FairbooksIOS 0x0000000100d6c224 mono_runtime_invoke + 124
2015-11-26 17:54:42.097 FairbooksIOS[204:5289] critical: 29 FairbooksIOS 0x0000000100d70aac mono_runtime_exec_main + 400
2015-11-26 17:54:42.097 FairbooksIOS[204:5289] critical: 30 FairbooksIOS 0x0000000100e0149c xamarin_main + 1840
2015-11-26 17:54:42.098 FairbooksIOS[204:5289] critical: 31 FairbooksIOS 0x0000000100bf6138 main + 96
2015-11-26 17:54:42.099 FairbooksIOS[204:5289] critical: 32 libdyld.dylib 0x000000019a0d28b8 <redacted> + 4
2015-11-26 17:54:42.099 FairbooksIOS[204:5289] critical:
This is possibly because you have your imagePicker as a local variable and it is collected by garbage collector before user selects an image. Try keeping imagePicker in global/class level. If problem still exists, check value of NavigationController (it may be null). Let me know if this works!
I'm trying to create a UIWebView and loading a page. When the loading finishes, I want to move to another screen.
The following code works on the iOS simulator, but not on a device.
I tried following this answer (Monotouch + UIWebView = Random Crashes), promoting the NSUrlRequest to become a global variable, but the error persists.
I tried using a try{} catch{} but it doesn't grab any exceptions when it crashes. it's driving me insane :)
void LoadSite(){
webView = new UIWebView (new CGRect (0, 0, 300,300));
string url = "http://google.com";
NSUrlRequest request = new NSUrlRequest(new NSUrl(url));
View.AddSubview (webView);
webView.LoadFinished+= (object sender, EventArgs e) => {
// CRASHES
};
webView.LoadRequest(request);
}
Any idea of how to solve this?
Thank you.
2015-05-03 19:28:08.465 Baru[5549:638056] critical: Stacktrace:
2015-05-03 19:28:08.466 Baru[5549:638056] critical: at <unknown> <0xffffffff>
2015-05-03 19:28:08.467 Baru[5549:638056] critical: at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSend (intptr,intptr) <0xffffffff>
2015-05-03 19:28:08.469 Baru[5549:638056] critical: at ObjCRuntime.Class.GetClassForObject (intptr) [0x00000] in /Users/builder/data/lanes/1503/6481535e/source/maccore/src/ObjCRuntime/Class.cs:111
2015-05-03 19:28:08.470 Baru[5549:638056] critical: at ObjCRuntime.Runtime.GetNSObject (intptr,System.Type,ObjCRuntime.Runtime/MissingCtorResolution,bool,bool&) [0x00024] in /Users/builder/data/lanes/1503/6481535e/source/maccore/src/ObjCRuntime/Runtime.cs:836
2015-05-03 19:28:08.471 Baru[5549:638056] critical: at ObjCRuntime.Runtime.GetNSObjectWithType (intptr,intptr,bool&) [0x0000c] in /Users/builder/data/lanes/1503/6481535e/source/maccore/src/ObjCRuntime/Runtime.cs:383
2015-05-03 19:28:08.472 Baru[5549:638056] critical: at ObjCRuntime.Runtime.get_nsobject_with_type (intptr,intptr,bool&) [0x00000] in /Users/builder/data/lanes/1503/6481535e/source/maccore/runtime/Delegates.generated.cs:208
2015-05-03 19:28:08.473 Baru[5549:638056] critical: at (wrapper native-to-managed) ObjCRuntime.Runtime.get_nsobject_with_type (intptr,intptr,int&) <0xffffffff>
2015-05-03 19:28:08.473 Baru[5549:638056] critical: at <unknown> <0xffffffff>
2015-05-03 19:28:08.474 Baru[5549:638056] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
2015-05-03 19:28:08.475 Baru[5549:638056] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Users/builder/data/lanes/1503/6481535e/source/maccore/src/UIKit/UIApplication.cs:63
2015-05-03 19:28:08.476 Baru[5549:638056] critical: at UIKit.UIApplication.Main (string[],string,string) [0x0001c] in /Users/builder/data/lanes/1503/6481535e/source/maccore/src/UIKit/UIApplication.cs:46
2015-05-03 19:28:08.476 Baru[5549:638056] critical: at Baru.Application.Main (string[]) [0x00008] in /Users/Montein/Proyectos/BRU/Solution/Baru/Baru/Main.cs:17
2015-05-03 19:28:08.477 Baru[5549:638056] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
2015-05-03 19:28:08.478 Baru[5549:638056] critical:
Native stacktrace:
2015-05-03 19:28:08.552 Baru[5549:638056] critical: 0 Baru 0x00000001003ee998 mono_handle_native_sigsegv + 264
2015-05-03 19:28:08.553 Baru[5549:638056] critical: 1 Baru 0x00000001003f8c6c mono_sigsegv_signal_handler + 324
2015-05-03 19:28:08.554 Baru[5549:638056] critical: 2 libsystem_platform.dylib 0x0000000194da495c _sigtramp + 68
2015-05-03 19:28:08.555 Baru[5549:638056] critical: 3 Baru 0x0000000100139a18 wrapper_managed_to_native_ObjCRuntime_Messaging_IntPtr_objc_msgSend_intptr_intptr + 104
2015-05-03 19:28:08.555 Baru[5549:638056] critical: 4 Baru 0x00000001000f9278 ObjCRuntime_Class_GetClassForObject_intptr + 40
2015-05-03 19:28:08.556 Baru[5549:638056] critical: 5 Baru 0x00000001000f17a8 ObjCRuntime_Runtime_GetNSObject_intptr_System_Type_ObjCRuntime_Runtime_MissingCtorResolution_bool_bool_ + 120
2015-05-03 19:28:08.557 Baru[5549:638056] critical: 6 Baru 0x00000001000ef8dc ObjCRuntime_Runtime_GetNSObjectWithType_intptr_intptr_bool_ + 108
2015-05-03 19:28:08.558 Baru[5549:638056] critical: 7 Baru 0x00000001000ede44 ObjCRuntime_Runtime_get_nsobject_with_type_intptr_intptr_bool_ + 36
2015-05-03 19:28:08.558 Baru[5549:638056] critical: 8 Baru 0x0000000100141c48 wrapper_native_to_managed_ObjCRuntime_Runtime_get_nsobject_with_type_intptr_intptr_int_ + 104
2015-05-03 19:28:08.559 Baru[5549:638056] critical: 9 Baru 0x00000001004afb78 xamarin_get_nsobject_with_type + 52
2015-05-03 19:28:08.559 Baru[5549:638056] critical: 10 Baru 0x00000001004afec4 xamarin_get_nsobject_with_type_for_ptr_created + 228
2015-05-03 19:28:08.560 Baru[5549:638056] critical: 11 Baru 0x00000001004b9500 xamarin_trampoline + 3860
2015-05-03 19:28:08.561 Baru[5549:638056] critical: 12 CoreFoundation 0x0000000182d5a100 <redacted> + 144
2015-05-03 19:28:08.561 Baru[5549:638056] critical: 13 CoreFoundation 0x0000000182c562fc <redacted> + 296
2015-05-03 19:28:08.562 Baru[5549:638056] critical: 14 CoreFoundation 0x0000000182c5ae30 <redacted> + 68
2015-05-03 19:28:08.562 Baru[5549:638056] critical: 15 WebKitLegacy 0x00000001924c0898 <redacted> + 172
2015-05-03 19:28:08.562 Baru[5549:638056] critical: 16 CoreFoundation 0x0000000182d57f6c <redacted> + 440
2015-05-03 19:28:08.562 Baru[5549:638056] critical: 17 CoreFoundation 0x0000000182c5accc _CF_forwarding_prep_0 + 92
2015-05-03 19:28:08.563 Baru[5549:638056] critical: 18 CoreFoundation 0x0000000182d5a100 <redacted> + 144
2015-05-03 19:28:08.563 Baru[5549:638056] critical: 19 CoreFoundation 0x0000000182c562fc <redacted> + 296
2015-05-03 19:28:08.563 Baru[5549:638056] critical: 20 WebCore 0x000000019164bda8 <redacted> + 212
2015-05-03 19:28:08.563 Baru[5549:638056] critical: 21 WebKitLegacy 0x00000001924c0650 <redacted> + 128
2015-05-03 19:28:08.563 Baru[5549:638056] critical: 22 WebCore 0x0000000191659414 <redacted> + 84
2015-05-03 19:28:08.564 Baru[5549:638056] critical: 23 WebCore 0x0000000191658790 <redacted> + 812
2015-05-03 19:28:08.564 Baru[5549:638056] critical: 24 WebCore 0x0000000191a6d694 <redacted> + 56
2015-05-03 19:28:08.564 Baru[5549:638056] critical: 25 WebCore 0x0000000191658230 <redacted> + 92
2015-05-03 19:28:08.564 Baru[5549:638056] critical: 26 WebCore 0x0000000191658190 <redacted> + 1588
2015-05-03 19:28:08.564 Baru[5549:638056] critical: 27 WebKitLegacy 0x00000001924d0a34 <redacted> + 228
2015-05-03 19:28:08.564 Baru[5549:638056] critical: 28 CoreFoundation 0x0000000182d5a100 <redacted> + 144
2015-05-03 19:28:08.565 Baru[5549:638056] critical: 29 CoreFoundation 0x0000000182c562fc <redacted> + 296
2015-05-03 19:28:08.565 Baru[5549:638056] critical: 30 CoreFoundation 0x0000000182c5ae30 <redacted> + 68
2015-05-03 19:28:08.565 Baru[5549:638056] critical: 31 WebKitLegacy 0x00000001924c0898 <redacted> + 172
2015-05-03 19:28:08.565 Baru[5549:638056] critical: 32 CoreFoundation 0x0000000182d57f6c <redacted> + 440
2015-05-03 19:28:08.565 Baru[5549:638056] critical: 33 CoreFoundation 0x0000000182c5accc _CF_forwarding_prep_0 + 92
2015-05-03 19:28:08.565 Baru[5549:638056] critical: 34 CoreFoundation 0x0000000182d5a100 <redacted> + 144
2015-05-03 19:28:08.566 Baru[5549:638056] critical: 35 CoreFoundation 0x0000000182c562fc <redacted> + 296
2015-05-03 19:28:08.566 Baru[5549:638056] critical: 36 WebCore 0x0000000191666efc <redacted> + 120
2015-05-03 19:28:08.566 Baru[5549:638056] critical: 37 CoreFoundation 0x0000000182d0c240 <redacted> + 24
2015-05-03 19:28:08.569 Baru[5549:638056] critical: 38 CoreFoundation 0x0000000182d0b4e4 <redacted> + 264
2015-05-03 19:28:08.569 Baru[5549:638056] critical: 39 CoreFoundation 0x0000000182d09594 <redacted> + 712
2015-05-03 19:28:08.569 Baru[5549:638056] critical: 40 CoreFoundation 0x0000000182c352d4 CFRunLoopRunSpecific + 396
2015-05-03 19:28:08.570 Baru[5549:638056] critical: 41 GraphicsServices 0x000000018c44b6fc GSEventRunModal + 168
2015-05-03 19:28:08.570 Baru[5549:638056] critical: 42 UIKit 0x00000001877fafac UIApplicationMain + 1488
2015-05-03 19:28:08.570 Baru[5549:638056] critical: 43 Baru 0x0000000100140d2c wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 348
2015-05-03 19:28:08.571 Baru[5549:638056] critical: 44 Baru 0x000000010010b82c UIKit_UIApplication_Main_string___intptr_intptr + 44
2015-05-03 19:28:08.572 Baru[5549:638056] critical: 45 Baru 0x000000010010b7ec UIKit_UIApplication_Main_string___string_string + 172
2015-05-03 19:28:08.572 Baru[5549:638056] critical: 46 Baru 0x00000001000cc11c Baru_Application_Main_string__ + 156
2015-05-03 19:28:08.573 Baru[5549:638056] critical: 47 Baru 0x0000000100267444 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 180
2015-05-03 19:28:08.573 Baru[5549:638056] critical: 48 Baru 0x00000001003faea4 mono_jit_runtime_invoke + 1260
2015-05-03 19:28:08.573 Baru[5549:638056] critical: 49 Baru 0x0000000100448cc4 mono_runtime_invoke + 128
2015-05-03 19:28:08.574 Baru[5549:638056] critical: 50 Baru 0x000000010044cf50 mono_runtime_exec_main + 404
2015-05-03 19:28:08.574 Baru[5549:638056] critical: 51 Baru 0x00000001004aed8c xamarin_main + 1844
2015-05-03 19:28:08.574 Baru[5549:638056] critical: 52 Baru 0x00000001003515b8 main + 96
2015-05-03 19:28:08.575 Baru[5549:638056] critical: 53 libdyld.dylib 0x0000000194bf6a08 <redacted> + 4
2015-05-03 19:28:08.575 Baru[5549:638056] critical:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
It looks good. please refer my code to show progress bar during loading.
it may be
1)Please check the internet connection
2)Debug in appdelege more than 12 sec crashes the application
string url = "http://manikandan.azurewebsites.net";
//Web View
webView.ShouldStartLoad += HandleShouldStartLoad;//Handle every url loads in webview
webView.LoadRequest (new NSUrlRequest (new NSUrl (url)));//Load Url in the same view
webView.LoadStarted += ProgressbarLoad;//Show progress bar while loading webview
void ProgressbarLoad (object sender, EventArgs e)
{
// Determine the correct size to start the overlay (depending on device orientation)
var bounds = UIScreen.MainScreen.Bounds; // portrait bounds
if (UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeLeft || UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeRight) {
bounds.Size = new SizeF(bounds.Size.Height, bounds.Size.Width);
}
// show the loading overlay on the UI thread using the correct orientation sizing
this._loadPop = new LoadingOverlay (bounds);
this.View.Add ( this._loadPop );
}