"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Terminating app due to uncaught exception NSRangeException

in my project that I am working on based on the Video Playback sample, we need to close and dispose the camera as soon as a target is detected. This happens fine on the first run but the second time that I start to run the camera again, it seems like there is a problem in reopening the camera! the error log is this:

 

Sep 23 15:27:03 Ali-tav kernel[0] <Debug>: AppleH4CamIn::power_on_hardwareSep 23 15:27:03 Ali-tav exSepanta[1295] <Error>: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 967977208 beyond bounds [0 .. 1]'    *** First throw call stack:    (0x2ebd5f03 0x3936ace7 0x2eb0c0cd 0x7459db 0x700fa9 0x6e182f 0x9d6089 0x9d6139 0x9d3a79 0x6d8451 0x6d8329 0x6360a7 0x6363dd 0x6185fd 0x74157f 0x39986959 0x399868cb 0x39984ae8)Sep 23 15:27:03 Ali-tav ReportCrash[1297] <Notice>: ReportCrash acting against PID 1295Sep 23 15:27:03 Ali-tav ReportCrash[1297] <Notice>: Formulating crash report for process exSepanta[1295]

 

and below is the complete log... showing that everything worked fine with the first run... then we closed everything and disposed them, but the above error occurs when trying to reopen the camera...

 

any help would be a lot appriciated.

Regards,

Hadi

 

Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=entering commandSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=command: initSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=entering initSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: -----------VideoPlaybackAppDelegate.initSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=entering dispatchVolumeEventSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --1---VPBVC---initSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --1---SAS---initWithDelegate:Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: screenBounds.width: 320.000000, screenBounds.height: 568.000000Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --5---SAS---isRetinaDisplaySep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: viewFrame.width: 640.000000, viewFrame.height: 1136.000000Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --13---VPBVC---shouldAutorotateSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --11---VPBVC---supportedInterfaceOrientationsSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --12---VPBVC---shouldAutorotateToInterfaceOrientation:Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --11---VPBVC---supportedInterfaceOrientationsSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --4---VPBVC---loadViewSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --2---VPBEAGLV---initWithFrame:rootViewController:appSession:Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --1---VPBEAGLV---layerClassSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: =================================videoPbAppDelegate.numVideoTargetsSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: videoPbAppDelegate.numVideoTargets: 5Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --5---SAS---isRetinaDisplaySep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --18---VPBEAGLV---initShadersSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: debug: shaderName=(Simple), shaderFileTYpe=(vertsh)Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: debug: shaderPath=(/var/mobile/Applications/DEF56C8E-3C2E-4D3D-9C41-FCDAC00CF975/exSepanta.app/Simple.vertsh)Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: debug: shaderName=(Simple), shaderFileTYpe=(fragsh)Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: debug: shaderPath=(/var/mobile/Applications/DEF56C8E-3C2E-4D3D-9C41-FCDAC00CF975/exSepanta.app/Simple.fragsh)Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --6---SAS---initAR:ARViewBoundsSize:orientation:Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --5---SAS---isRetinaDisplaySep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --7---VPBVC---viewDidLoadSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --7---SAS---initQCARInBackgroundSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --4---VPBEAGLV---prepareSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --11---VPBVC---supportedInterfaceOrientationsSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: run    |    Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: INFO/AR(1295) 2014-09-23 15:26:44: QCAR SDK version 3.0.9Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --11---SAS---prepareARSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --12---SAS---initTrackerSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --20---VPBVC---doInitTrackersSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --13---SAS---loadTrackerDataSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --14---SAS---loadTrackerDataInBackgroundSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --21---VPBVC---doLoadTrackersDataSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --30---VPBVC---loadAndActivateImageTrackerDataSet:Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: loadAndActivateImageTrackerDataSet (targets.xml)Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: INFO/AR(1295) 2014-09-23 15:26:44: ImageTracker: Successfully created datasetSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: INFO: successfully loaded data setSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: INFO: successfully activated data setSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --23---VPBVC---onInitARDoneSep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --17---SAS---startAR:error:Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: --16---SAS---startCamera:viewWidth:andHeight:error:Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: viewWidth: 640.000000, viewHeight: 1136.000000Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: *************************camera: 1Sep 23 15:26:44 Ali-tav exSepanta[1295] <Warning>: *** -[AVCaptureVideoDataOutput setVideoSettings:] - videoSettings dictionary contains one or more unsupported (ignored) keys: (        Width,        AVVideoScalingModeKey,        Height    )Sep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: --1---VPBEAGLV---layerClassSep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: DEBUG/AR(1295) UIView has CAEAGLLayer classSep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: DEBUG/AR(1295) UIView responds to selector renderFrameQCARSep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: initialize the cameraSep 23 15:26:45 Ali-tav kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 1Sep 23 15:26:45 Ali-tav kernel[0] <Debug>: AppleH4CamIn::power_on_hardwareSep 23 15:26:45 Ali-tav kernel[0] <Debug>: AppleH4CamIn::ISP_SelectBestMIPIFrequencyIndex_gated - channel: 0, index: 0Sep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: start the cameraSep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: --22---VPBVC---doStartTrackersSep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: ask the application to start the tracker(s)Sep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: --15---SAS---configureVideoBackgroundWithViewWidth:andHeight:Sep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: 10101010101VideoBackgroundConfig: size: 852,1136Sep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: 10101010101VideoMode:w=640 h=480Sep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: 10101010101width=640.000 height=1136.000Sep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: 10101010101ViewPort: X,Y: -106,0 Size X,Y:852,1136Sep 23 15:26:45 Ali-tav exSepanta[1295] <Warning>: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.Sep 23 15:26:55 Ali-tav exSepanta[1295] <Warning>: CFNetwork SSLHandshake failed (-9806)Sep 23 15:26:56 Ali-tav exSepanta[1295] <Warning>: CFNetwork SSLHandshake failed (-9806)Sep 23 15:26:57 Ali-tav exSepanta[1295] <Warning>: CFNetwork SSLHandshake failed (-9806)Sep 23 15:26:57 Ali-tav exSepanta[1295] <Warning>: NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9806)Sep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: *^*^*^*^*^*^*^*^*target knowing: 0Sep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=entering dispatchVolumeEventSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: targetKnowing    |    Sep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: *^*^*^*^*^*^*^*^*video not exist: 0Sep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: --8---VPBVC---viewWillDisappear:Sep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: --5---VPBEAGLV---dismissSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: 7777777777777777unloadSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: 7777777777777777unloadSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: 7777777777777777unloadSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: 7777777777777777unloadSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: 7777777777777777unloadSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: --18---SAS---stopAR:Sep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: self.cameraIsActive: 1Sep 23 15:26:58 Ali-tav kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 0Sep 23 15:26:58 Ali-tav kernel[0] <Debug>: AppleH4CamIn::power_off_hardwareSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: --25---VPBVC---doStopTrackersSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: --26---VPBVC---doUnloadTrackersDataSep 23 15:26:58 Ali-tav exSepanta[1295] <Warning>: --27---VPBVC---doDeinitTrackersSep 23 15:26:59 Ali-tav exSepanta[1295] <Warning>: --7---VPBEAGLV---finishOpenGLESCommandsSep 23 15:26:59 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=entering dispatchVolumeEventSep 23 15:26:59 Ali-tav exSepanta[1295] <Warning>: videoNotExist    |    Sep 23 15:26:59 Ali-tav exSepanta[1295] <Warning>: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=entering commandSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=command: initSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=entering initSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: =-=-=-=-=-=-=entering dispatchVolumeEventSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: ***************VPBVC.runSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: ***************is exist selfSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --6---SAS---initAR:ARViewBoundsSize:orientation:Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --5---SAS---isRetinaDisplaySep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --13---VPBVC---shouldAutorotateSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --7---SAS---initQCARInBackgroundSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --11---VPBVC---supportedInterfaceOrientationsSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --12---VPBVC---shouldAutorotateToInterfaceOrientation:Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --11---VPBVC---supportedInterfaceOrientationsSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --11---VPBVC---supportedInterfaceOrientationsSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: INFO/AR(1295) 2014-09-23 15:27:03: QCAR SDK version 3.0.9Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: start    |    5Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --11---SAS---prepareARSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --12---SAS---initTrackerSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --20---VPBVC---doInitTrackersSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --13---SAS---loadTrackerDataSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --14---SAS---loadTrackerDataInBackgroundSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --21---VPBVC---doLoadTrackersDataSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --30---VPBVC---loadAndActivateImageTrackerDataSet:Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: loadAndActivateImageTrackerDataSet (targets.xml)Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: INFO/AR(1295) 2014-09-23 15:27:03: ImageTracker: Successfully created datasetSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: INFO: successfully loaded data setSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: INFO: successfully activated data setSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --23---VPBVC---onInitARDoneSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --17---SAS---startAR:error:Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --16---SAS---startCamera:viewWidth:andHeight:error:Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: viewWidth: 640.000000, viewHeight: 1136.000000Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: *************************camera: 1Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: *** -[AVCaptureVideoDataOutput setVideoSettings:] - videoSettings dictionary contains one or more unsupported (ignored) keys: (        Width,        AVVideoScalingModeKey,        Height    )Sep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: --1---VPBEAGLV---layerClassSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: DEBUG/AR(1295) UIView has CAEAGLLayer classSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: DEBUG/AR(1295) UIView responds to selector renderFrameQCARSep 23 15:27:03 Ali-tav exSepanta[1295] <Warning>: initialize the cameraSep 23 15:27:03 Ali-tav kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 1Sep 23 15:27:03 Ali-tav kernel[0] <Debug>: AppleH4CamIn::power_on_hardwareSep 23 15:27:03 Ali-tav exSepanta[1295] <Error>: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 967977208 beyond bounds [0 .. 1]'    *** First throw call stack:    (0x2ebd5f03 0x3936ace7 0x2eb0c0cd 0x7459db 0x700fa9 0x6e182f 0x9d6089 0x9d6139 0x9d3a79 0x6d8451 0x6d8329 0x6360a7 0x6363dd 0x6185fd 0x74157f 0x39986959 0x399868cb 0x39984ae8)Sep 23 15:27:03 Ali-tav ReportCrash[1297] <Notice>: ReportCrash acting against PID 1295Sep 23 15:27:03 Ali-tav ReportCrash[1297] <Notice>: Formulating crash report for process exSepanta[1295]Sep 23 15:27:03 Ali-tav kernel[0] <Debug>: AppleH4CamIn::ISP_SelectBestMIPIFrequencyIndex_gated - channel: 0, index: 0Sep 23 15:27:03 Ali-tav mediaserverd[46] <Warning>: 15:27:03.956 [0x2439000] CMSession retain count > 1!Sep 23 15:27:03 Ali-tav com.apple.launchd[1] (UIKitApplication:com.doitflash.exSepanta[0xcecf][1295]) <Warning>: (UIKitApplication:com.doitflash.exSepanta[0xcecf]) Job appears to have crashed: Abort trap: 6Sep 23 15:27:04 Ali-tav backboardd[28] <Warning>: Application 'UIKitApplication:com.doitflash.exSepanta[0xcecf]' exited abnormally with signal 6: Abort trap: 6Sep 23 15:27:04 Ali-tav ReportCrash[1297] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/exSepanta_2014-09-23-152703_Ali-tav.ips using uid: 0 gid: 0, synthetic_euid: 501 egid: 0Sep 23 15:27:04 Ali-tav kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 0Sep 23 15:27:04 Ali-tav kernel[0] <Debug>: AppleH4CamIn::power_off_hardwareSep 23 15:27:10 Ali-tav mstreamd[1294] <Notice>: (Note ) mstreamd: Not monitoring for external power.Sep 23 15:27:10 Ali-tav mstreamd[1294] <Notice>: (Note ) PS: Media stream daemon stopping.Sep 23 15:27:10 Ali-tav mstreamd[1294] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x17ea3570>: Shared Streams daemon has shut down.Sep 23 15:27:10 Ali-tav mstreamd[1294] <Notice>: (Warn ) mstreamd: mstreamd shutting down.Sep 23 15:27:10 Ali-tav mstreamd[1298] <Notice>: (Note ) mstreamd: mstreamd starting up.Sep 23 15:27:10 Ali-tav mstreamd[1298] <Notice>: (Note ) PS: Media stream daemon starting...