iOS Question Camera Upload in Webview crashes app immediately

Martin Larsen

Active Member
Licensed User
Longtime User
I have a webview where the user can upload an image. When you click the Choose button, IOS gives you 3 choices:
  • Take Photo or Video
  • Photo Library
  • Browser
The latter two works fine, but if I choose to take a photo, the app crashes immediately with the following error:

B4X:
SignalHandler 6
Error occurred on line: 127 (ImageSlider)
Signal - 6
Stack Trace: (
    "0   result               SignalHandler + 120",
    "1   libsystem_platform.dylib            0x00000001b65c1884 A5D5822C-7622-3859-B0C0-B869B7E244B5 + 34948",
    "2   libsystem_kernel.dylib              0x00000001b66b0e58 B422BA38-A9F6-3062-BE28-D28D39E3FE25 + 167512",
    "3   libsystem_kernel.dylib              0x00000001b66b0e88 B422BA38-A9F6-3062-BE28-D28D39E3FE25 + 167560",
    "4   TCC                  E8EB1BFD-F24D-34F2-A53B-5D0700632050 + 7340",
    "5   TCC                  E8EB1BFD-F24D-34F2-A53B-5D0700632050 + 7148",
    "6   TCC                  E8EB1BFD-F24D-34F2-A53B-5D0700632050 + 23328",
    "7   libxpc.dylib         9E9D069D-E3B1-36FA-8575-5E1D9E6B6B54 + 97252",
    "8   libxpc.dylib         9E9D069D-E3B1-36FA-8575-5E1D9E6B6B54 + 50352",
    "9   libdispatch.dylib    5A83D0CF-8FB9-3727-8A32-012D20A47EC8 + 374180"
)

The line number, here 127 in ImageSlider, is probably not correct. Because if I disable the ImageSlider, the error just happens somewhere else in a completely different module.

Sometimes I see the camera app for half a second or so before the crash. Mostly the app just terminates.

Any help or hints would be appreciated!
 

JohnC

Expert
Licensed User
Longtime User
Do you have a permission reason line like this in the Project Attributes Region?

B4X:
#PlistExtra:<key>NSCameraUsageDescription</key><string>Allows you to take a photo or video.</string>
 
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
Doh!
Thanks, that did the trick :)

My next question is then: How can I detect if the user denies the permission? If she does, the app crashes the same way as before.
 
Last edited:
Upvote 0

JohnC

Expert
Licensed User
Longtime User
One of these threads will hopefully lead you to a way:


 
Upvote 0
Top