2017-05-02 17 views
0

iOS 10.3.1へのアップデート後にアプリケーションがクラッシュし始めました。カメラを使用してビデオを選択しようとするとクラッシュします。このアプリは、古いバージョンのios(9.3.5および10.2.1)でもうまく機能します。 クラッシュログは、それがクラッシュするCAMImagePickerCameraViewControllerであることを示しています。私はcrashlyticsで見るiOS CAMImagePickerCameraViewControllerがiOS 10.3.1でクラッシュする

OS Version:   iPhone OS 10.3.1 (14E304) 
Report Version:  104 

Exception Type: EXC_BAD_ACCESS (SIGSEGV) 
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000019 
Termination Signal: Segmentation fault: 11 
Termination Reason: Namespace SIGNAL, Code 0xb 
Terminating Process: exc handler [0] 
Triggered by Thread: 0 

Filtered syslog: 
None found 

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 libobjc.A.dylib     0x1b946f4e realizeClass(objc_class*) + 18 
1 libobjc.A.dylib     0x1b94704c realizeClass(objc_class*) + 272 
2 libobjc.A.dylib     0x1b94abc6 lookUpImpOrForward + 94 
3 libobjc.A.dylib     0x1b94ab64 _class_lookupMethodAndLoadCache3 + 26 
4 libobjc.A.dylib     0x1b9511ae _objc_msgSend_uncached + 14 
5 CameraUI      0x2f8d6896 -[CAMImagePickerCameraViewController _handleCapturedImagePickerVideoAtPath:withEditingMetadata:] + 166 
6 CameraUI      0x2f8d609a -[CAMImagePickerCameraViewController cropOverlayWasOKed:] + 478 
7 UIKit       0x2191e804 -[UIApplication sendAction:to:from:forEvent:] + 76 
8 UIKit       0x2191e798 -[UIControl sendAction:to:forEvent:] + 62 
9 UIKit       0x21908dc8 -[UIControl _sendActionsForEvents:withEvent:] + 478 
10 UIKit       0x2191e0d4 -[UIControl touchesEnded:withEvent:] + 604 
11 UIKit       0x2191dc1e -[UIWindow _sendTouchesForEvent:] + 2094 
12 UIKit       0x21918b5e -[UIWindow sendEvent:] + 2798 
13 UIKit       0x218ea702 -[UIApplication sendEvent:] + 308 
14 UIKit       0x2207dd36 __dispatchPreprocessedEventFromEventQueue + 2254 
15 UIKit       0x220786da __handleEventQueue + 4186 
16 UIKit       0x22078abc __handleHIDEventFetcherDrain + 144 
17 CoreFoundation     0x1c677fdc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12 
18 CoreFoundation     0x1c677b04 __CFRunLoopDoSources0 + 424 
19 CoreFoundation     0x1c675f50 __CFRunLoopRun + 1160 
20 CoreFoundation     0x1c5c90ee CFRunLoopRunSpecific + 470 
21 CoreFoundation     0x1c5c8f10 CFRunLoopRunInMode + 104 
22 GraphicsServices    0x1dd73b40 GSEventRunModal + 80 
23 UIKit       0x2194de82 UIApplicationMain + 150 
24 Stringr Dev      0x00181604 0x82000 + 1046020 
25 libdyld.dylib     0x1bdb64ea start + 2 

同様のクラッシュは、次のとおりです。ここで

Crashed: com.apple.main-thread 
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000c839e660 

libobjc.A.dylib realizeClass(objc_class*) + 25 

libobjc.A.dylib _objc_msgSend_uncached + 14 

CameraUI -[CAMImagePickerCameraViewController _handleCapturedImagePickerVideoAtPath:withEditingMetadata:] 

CameraUI -[CAMImagePickerCameraViewController cropOverlayWasOKed:] 

UIKit UIApplicationMain + 150 

は私のコードからの抜粋です:

/// Presents the video selection/capture dialog 
    fileprivate func presentPickerController() { 
     // Request authorization to access photo library if not yet granted 
     PHPhotoLibrary.requestAuthorization { status in 
      guard status == .authorized else { 
       self.alert(.notPermittedToSelectVideos) 
       return 
      } 

      // Create the custom asset picker (to get multiple at once) 
      let assetsPickerController = DKImagePickerController() 
      assetsPickerController.defaultAssetGroup = .smartAlbumVideos 
      assetsPickerController.showsCancelButton = true 
      assetsPickerController.assetType = .allVideos 
      assetsPickerController.didSelectAssets = self.didSelectAssets 
      assetsPickerController.didCancel = self.didCancel 
      assetsPickerController.disableCaptureWhenSelected = true 
      assetsPickerController.createCaptureController = self.createCaptureController 

      self.assetsPickerController = assetsPickerController 
      DispatchQueue.main.async { 
       self.present(assetsPickerController, animated: true) {} 
      } 
     } 
    } 

fileprivate func createCaptureController() -> UIViewController? { 
     let imagePickerController = UIImagePickerController() 
     imagePickerController.sourceType = .camera 
     imagePickerController.mediaTypes = [kUTTypeMovie as String] 
     imagePickerController.videoQuality = .typeHigh 
     imagePickerController.delegate = self 
     guard canCaptureVideo() else { 
      Logger.info?.message("Attempted to capture video when cannot capture video") 
      alert(.cantCaptureVideo) 
      return nil 
     } 

     guard permittedToCaptureVideo() else { 
      Logger.info?.message("Attempted to capture video when cannot capture video") 
      alert(.notPermittedToCaptureVideo) 
      return nil 
     } 

     guard permittedToCaptureAudio() else { 
      Logger.info?.message("Attempted to capture video when cannot capture audio") 
      alert(.notPermittedToCaptureAudio) 
      return nil 
     } 

     return imagePickerController 
    } 

クラッシュするコントローラはアプリケーションの一部ではなく、手で触れることができません。どの人がこの問題を解決できるか考えている人はいますか? CAMImagePickerCameraViewControllerの目的は何ですか?なぜIos 10.3.1でクラッシュするだけで、以前のバージョンではクラッシュしないのですか?

+0

私たちはまったく同じ問題を抱えています。あなたは解決策を見つけましたか? –

答えて

0

私はここで似たような問題を抱えていますが、私はデリゲートの問題だと感じました。

だから私が思う私の問題は、のViewControllerがオブジェクトを保持し、私はのViewControllerに、オブジェクトの弱いデリゲートを設定し、のViewControllerを却下し、オブジェクトがまだ何かをするデリゲートを使用しようとすると、クラッシュが発生した...

弱参照は間違っています...なぜそれが起こるのか分かりませんが、viewController deallocメソッドにコードブローを加えることでこれを修正できます - (void)dealloc{ self.assetsPickerController = nil }

関連する問題