It does not crash on iPhone 5.
The following app crashes as soon as you tap "Take picture".
<App>
<JavaScript>
var Observable = require("FuseJS/Observable");
var Camera = require("FuseJS/Camera");
var ImageTools = require("FuseJS/ImageTools")
var picture = Observable();
function snap()
{
Camera.takePicture().then(function(image)
{
picture.value = image;
ImageTools.getBufferFromImage(image).then(function(buffer) {
router.goto("takenPicture");
}).catch(function(e) {
console.log("1 " + e);
});
}).catch(function(e) {
console.log("2 " + e);
});
}
module.exports =
{
snap
}
</JavaScript>
<DockPanel>
<iOS.StatusBarConfig ux:Name="statusBarConfig" Style="Light" IsVisible="false" />
<Router ux:Name="router"/>
<Navigator DefaultPath="start">
<StartPage ux:Template="start"/>
<TakenPicturePage ux:Template="takenPicture"/>
</Navigator>
<BottomBarBackground Dock="Bottom" />
</DockPanel>
<Page ux:Class="StartPage" Alignment="Center">
<Text Value="Take picture" Clicked="{snap}" />
</Page>
<Page ux:Class="TakenPicturePage" Alignment="Center">
<Text Value="Took picture" />
</Page>
</App>
Crash7 was compiled with optimization - stepping may behave oddly; variables may not be available.
* thread #10, stop reason = signal SIGABRT
frame #0: 0x000000018a03b014 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x000000018a103450 libsystem_pthread.dylib`pthread_kill + 112
frame #2: 0x0000000189faf400 libsystem_c.dylib`abort + 140
frame #3: 0x0000000189a792d4 libc++abi.dylib`abort_message + 132
frame #4: 0x0000000189a96cc0 libc++abi.dylib`default_terminate_handler() + 304
frame #5: 0x0000000189aa4844 libobjc.A.dylib`_objc_terminate() + 124
frame #6: 0x0000000189a9366c libc++abi.dylib`std::__terminate(void (*)()) + 16
frame #7: 0x0000000189a92f84 libc++abi.dylib`__cxa_throw + 136
frame #8: 0x0000000189aa4690 libobjc.A.dylib`objc_exception_throw + 364
frame #9: 0x000000018b06d08c CoreFoundation`+[NSException raise:format:arguments:] + 104
frame #10: 0x000000018bb2502c Foundation`-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
frame #11: 0x00000001911a3690 UIKit`-[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] + 196
frame #12: 0x00000001911fad70 UIKit`+[UIWindow _synchronizeDrawingWithPreCommitHandler:] + 68
frame #13: 0x0000000190fdde7c UIKit`-[UIApplication _setStatusBarHidden:animationParameters:changeApplicationFlag:] + 700
frame #14: 0x0000000190f29448 UIKit`-[UIApplication _updateCurrentStatusBarViewControllerAppearance] + 436
frame #15: 0x0000000190f98308 UIKit`-[UIViewController setNeedsStatusBarAppearanceUpdate] + 204
frame #16: 0x000000019101e318 UIKit`-[UIViewController _setPresentedStatusBarViewController:] + 96
frame #17: 0x000000019128d488 UIKit`-[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1512
frame #18: 0x000000019128edec UIKit`-[UIViewController _presentViewController:withAnimationController:completion:] + 4524
frame #19: 0x0000000191291920 UIKit`-[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 524
frame #20: 0x0000000191015154 UIKit`-[UIViewController presentViewController:animated:completion:] + 184
* frame #21: 0x00000001000fd3b0 Crash7`-[ImagePicker openImagePickerWithSourceType:then:or:](self=<unavailable>, _cmd=<unavailable>, type=<unavailable>, a=<unavailable>, or=<unavailable>) at ImagePicker.m:22 [opt]
frame #22: 0x00000001000fa738 Crash7`-[CameraHelper takePictureWithCompletionHandler:onFail:](self=0x0000000170467a40, _cmd=<unavailable>, onComplete=<unavailable>, onFail=<unavailable>) at CameraHelper.m:16 [opt]
frame #23: 0x000000010028b6d8 Crash7`g::Fuse::Camera::iOSCamera::TakePictureInternal(uDelegate*, uDelegate*) [inlined] g::Fuse::Camera::iOSCamera::TakePictureInternal(uDelegate*, uDelegate*)::$_0::operator()(void (NSString*) block_pointer, void (NSString*) block_pointer) const at Fuse.Camera.iOSCamera.mm:64 [opt]
frame #24: 0x000000010028b6a4 Crash7`g::Fuse::Camera::iOSCamera::TakePictureInternal(onComplete=<unavailable>, onFail=<unavailable>) at Fuse.Camera.iOSCamera.mm:62 [opt]
frame #25: 0x000000010028afd8 Crash7`g::Fuse::Camera::Camera::TakePictureInterface(uArray*) [inlined] g::Fuse::Camera::Camera::TakePicture1(p=<unavailable>) at Fuse.Camera.g.cpp:134 [opt]
frame #26: 0x000000010028afd4 Crash7`g::Fuse::Camera::Camera::TakePictureInterface(args=<unavailable>) at Fuse.Camera.g.cpp:158 [opt]
frame #27: 0x000000010028aefc Crash7`g::Fuse::Camera::Camera__TakePictureInterface_fn(args=<unavailable>, __retval=0x000000016e20a450) at Fuse.Camera.g.cpp:100 [opt]
frame #28: 0x00000001000f5df8 Crash7`uDelegate::Invoke(this=0x000000017428fff0, retval=<unavailable>, args=0x000000016e20a460, count=2) at ObjectModel.cpp:1462 [opt]
frame #29: 0x00000001000f6114 Crash7`uDelegate::Invoke(this=<unavailable>, count=<unavailable>) at ObjectModel.cpp:1553 [opt]
frame #30: 0x00000001001a1ac4 Crash7`g::Fuse::Scripting::NativePromise__ContextClosure::CreatePromise(this=0x00000001704769c0, args=0x00000001704681c0) at Fuse.Scripting.g.cpp:1063 [opt]
frame #31: 0x00000001001a1a20 Crash7`g::Fuse::Scripting::NativePromise__ContextClosure__CreatePromise_fn(__this=<unavailable>, args=<unavailable>, __retval=0x000000016e20a590) at Fuse.Scripting.g.cpp:1039 [opt]
frame #32: 0x00000001000f5df8 Crash7`uDelegate::Invoke(this=0x00000001702904a0, retval=<unavailable>, args=0x000000016e20a5a0, count=3) at ObjectModel.cpp:1462 [opt]
frame #33: 0x00000001000f6114 Crash7`uDelegate::Invoke(this=<unavailable>, count=<unavailable>) at ObjectModel.cpp:1553 [opt]
frame #34: 0x00000001001acc94 Crash7`g::Fuse::Scripting::JavaScriptCore::Context__CallbackWrapper::Call(this=0x0000000170476a00, args=<unavailable>, exception=0x000000016e20a770) at Fuse.Scripting.JavaScriptCore.g.cpp:227 [opt]
frame #35: 0x00000001001acc3c Crash7`g::Fuse::Scripting::JavaScriptCore::Context__CallbackWrapper__Call_fn(__this=<unavailable>, args=<unavailable>, exception=<unavailable>, __retval=0x000000016e20a6c0) at Fuse.Scripting.JavaScriptCore.g.cpp:204 [opt]
frame #36: 0x00000001000f5df8 Crash7`uDelegate::Invoke(this=0x00000001702904f0, retval=<unavailable>, args=0x000000016e20a6d0, count=4) at ObjectModel.cpp:1462 [opt]
frame #37: 0x00000001000f6114 Crash7`uDelegate::Invoke(this=<unavailable>, count=<unavailable>) at ObjectModel.cpp:1553 [opt]
frame #38: 0x00000001001b01c4 Crash7`g::Fuse::Scripting::JavaScriptCore::JSClassRef::CreateUnoCallback()::$_1::__invoke(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) [inlined] g::Fuse::Scripting::JavaScriptCore::JSClassRef::CreateUnoCallback()::$_1::operator()(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) const at Fuse.Scripting.JavaScriptCore.g.cpp:884 [opt]
frame #39: 0x00000001001b0190 Crash7`g::Fuse::Scripting::JavaScriptCore::JSClassRef::CreateUnoCallback(ctx=<unavailable>, function=<unavailable>, thisObject=<unavailable>, argumentCount=0, arguments=0x000000016e20a788, exception=0x000000016e20a770)::$_1::__invoke(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) at Fuse.Scripting.JavaScriptCore.g.cpp:869 [opt]
frame #40: 0x000000018f59a5e0 JavaScriptCore`JSC::JSCallbackObject<JSC::JSDestructibleObject>::call(JSC::ExecState*) + 424
frame #41: 0x000000018efb180c JavaScriptCore`JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 480
frame #42: 0x000000018f69861c JavaScriptCore`llint_entry + 24876
frame #43: 0x000000018f692328 JavaScriptCore`vmEntryToJavaScript + 264
frame #44: 0x000000018f564a68 JavaScriptCore`JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 168
frame #45: 0x000000018efb58c4 JavaScriptCore`JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 352
frame #46: 0x000000018f2289f8 JavaScriptCore`JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 160
frame #47: 0x000000018efb5678 JavaScriptCore`JSObjectCallAsFunction + 536
frame #48: 0x00000001001aed14 Crash7`g::Fuse::Scripting::JavaScriptCore::JSObjectRef::CallAsFunction(__this=<unavailable>, ctx=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, onException=0x000000017028ae60) at Fuse.Scripting.JavaScriptCore.g.cpp:1217 [opt]
frame #49: 0x00000001001ae9e4 Crash7`g::Fuse::Scripting::JavaScriptCore::Function__Call_fn(__this=0x0000000170477640, args=<unavailable>, __retval=0x000000016e20adb8) at Fuse.Scripting.JavaScriptCore.g.cpp:751 [opt]
frame #50: 0x00000001001bb448 Crash7`g::Fuse::Reactive::FunctionMirror__CallClosure::Call() [inlined] g::Fuse::Scripting::Function::Call(this=<unavailable>, args=<unavailable>) at Fuse.Scripting.Function.h:30 [opt]
frame #51: 0x00000001001bb434 Crash7`g::Fuse::Reactive::FunctionMirror__CallClosure::Call(this=0x0000000170475b80) at Fuse.Reactive.g.cpp:604 [opt]
frame #52: 0x00000001001cc364 Crash7`g::Fuse::Reactive::ThreadWorker::RunInner(this=0x0000000170112750) at Fuse.Reactive.g.cpp:8040 [opt]
frame #53: 0x00000001001cc0fc Crash7`g::Fuse::Reactive::ThreadWorker::Run(this=0x0000000170112750) at Fuse.Reactive.g.cpp:7975 [opt]
frame #54: 0x00000001000fc9b0 Crash7`ThreadStartup(arg=0x000000017046c500) at posix_thread.cpp:44 [opt]
frame #55: 0x000000018a101850 libsystem_pthread.dylib`_pthread_body + 240
frame #56: 0x000000018a101760 libsystem_pthread.dylib`_pthread_start + 284
frame #57: 0x000000018a0fed94 libsystem_pthread.dylib`thread_start + 4
(lldb)