iOS Question iMedia Lib problem....


Licensed User
hi, i am using the imedia lib to use cam.takepicture and cam.takevideo

the problem is when i use the camera more then once my app crashes.

it does not happen everytime sometimes it works ok but sometimes it crashes...

Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
"<NSLayoutConstraint:0x1c14ea80 V:|-(11)-[CAMFlipButton:0x1c1525e0] (Names: '|':CAMBottomBar:0x1c1574d0 )>",
"<NSLayoutConstraint:0x1c14ed10 CAMShutterButton:0x1c1548e0.centerY == CAMBottomBar:0x1c1574d0.centerY>",
"<NSLayoutConstraint:0x1c14f510 'UIView-Encapsulated-Layout-Height' V:[PLImagePickerCameraView:0x17981800(0)]>",
"<NSLayoutConstraint:0x1c13ad70 CAMBottomBar:0x1c1574d0.height == PLImagePickerCameraView:0x17981800.height>",
"<NSLayoutConstraint:0x1c1352e0 V:[CAMFlipButton:0x1c1525e0]-(0)-[UIView:0x1c1410d0]>",
"<NSLayoutConstraint:0x1c151830 UIView:0x1c1410d0.bottom ==>"
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1c1352e0 V:[CAMFlipButton:0x1c1525e0]-(0)-[UIView:0x1c1410d0]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
Error occurred on line: 1540 (main)
UIPopoverPresentationController (<UIPopoverPresentationController: 0x1c1ea940>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.
Stack Trace: (
CoreFoundation <redacted> + 150
libobjc.A.dylib objc_exception_throw + 38
UIKit <redacted> + 2696
UIKit <redacted> + 1196
UIKit <redacted> + 150
UIKit <redacted> + 308
UIKit <redacted> + 458
CoreFoundation <redacted> + 20
CoreFoundation <redacted> + 276
CoreFoundation <redacted> + 914
CoreFoundation CFRunLoopRunSpecific + 476
CoreFoundation CFRunLoopRunInMode + 106
GraphicsServices GSEventRunModal + 136
UIKit UIApplicationMain + 1440
Safe Area main + 116
libdyld.dylib <redacted> + 2


Licensed User
Are you able to reproduce it with a simple project?
yes, and it happens on my ipad (on iphone everything is fine)

i start camera and then hit cancel again camera again cancel after few times it crashes..
also when i load image after few times it crashes...

apple report (reason why they rejected my app)

  • Reasons
  • 2.1: Apps that crash will be rejected
  • 8.1: Apps must comply with all terms and conditions explained in the Guidelines for Using Apple Trademarks and Copyrights and the Apple Trademark List
----- 2.1 -----

We found that your app crashed on iPad running iOS 8.1.1, which is not in compliance with the App Store Review Guidelines.

Your App crashes when we select an image to save in the Photos tab

This occurred when your app was used:

- On Wi-Fi

We have attached detailed crash logs to help troubleshoot this issue. For information on how to symbolicate and read a crash log, please see Tech Note TN2151 Understanding and Analyzing iPhone OS Application Crash Reports.

If you have difficulty reproducing this issue, please try testing the workflow as described in Testing Workflow with Xcode's Archive feature.

For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. Please be sure to prepare any symbolicated crash logs, screenshots, or steps to reproduce the issues for when the DTS engineer follows up.

----- 8.1 -----

We found that your app does not comply with the Guidelines for Using Apple's Trademarks and Copyrights, as required by the App Store Review Guidelines.

Specifically, your app includes:

-feature buttons too similar to iOS app icons

Please see the attached screenshot/s for more information.

For your convenience, we've provided the relevant section/s of the Guidelines for Using Apple's Trademarks and Copyrights.

Apple Logo and Apple-owned Graphic Symbols

You may not use the Apple Logo or any other Apple-owned graphic symbol, logo, or icon on or in connection with web sites, products, packaging, manuals, promotional/advertising materials, or for any other purpose except pursuant to an express written trademark license from Apple, such as a reseller agreement.Questions or comments?

To provide additional information, or ask questions, about the rejection details, please use the Reply field in the Resolution Center. This is the most direct way to communicate with the App Store Review team to resolve issues as quickly as possible.


Licensed User
Is the iPad running iOS 8?

Are you sure that it happens when you are calling TakePicture and not only with SelectFromPhoto...?

yes the ipad is running ios8+, and it happend also when i only tried to take a pic...

what i have done is, i changed the TARGETED_DEVICE_FAMILY = "1,2" to TARGETED_DEVICE_FAMILY = "1" (LINE 240 only) so it will run only on iphones, and i was still able to install it on my ipad2 (ios8) and now everything works perfect...

i tought if i change the target device family it wont be installed on ipads but it did, if i will upload my build like this ipads wont find it right??


i will try also your second advice (intialize the cam before use it)

Mark Turney

Active Member
Licensed User
Erel's suggestion to reinitialize the cam each time worked to resolve the iPad crash for me. Here's the code I used .... works on iPhone and iPad now, no matter how many times I switch back and forth between take pic and choose image. My devices are iPhone 6 plus and iPAD Mini original model, both running iOS 8.1.3.
Sub imgPrompt_click(ButtonText As String)                                                  
    If App.iPadDevice = True Then
        If ButtonText = "Take" Then
            cam1.Initialize("cam1", Page1)
            takePicOrChoose = 1
            chooseView.Visible = True
            cam1.SelectFromPhotoLibrary(chooseView, cam1.TYPE_IMAGE)
            takePicOrChoose = 2
        End If
        If ButtonText = "Take" Then
            takePicOrChoose = 1
            cam1.SelectFromPhotoLibrary(Sender, cam1.TYPE_IMAGE)
            takePicOrChoose = 2
        End If
    End If
End Sub
Sub cam1_Complete (Success As Boolean, Image As Bitmap, VideoPath As String)
        If Success Then
            If Image.IsInitialized Then
                GraphPaper.ContentMode = GraphPaper.MODE_FIT
                GraphPaper.Bitmap = Image
            End If
        End If
    If takePicOrChoose = 1 Then                                'Checks a variable in order to save original image if taken (before user modifies pic)
    End If
    chooseView.Visible = False
End Sub
Hope this helps someone!