iOS Question Inconsistent iMedia execution

jai

Active Member
Licensed User
Longtime User
An existing app that used to work fine for taking snapshots is now crashing on iPhone when trying to take a photo. It still works fine on iPad but no longer on iPhone 6s or iPhone 4s. Same code in other apps works fine on all devices (audio recording results are also similar).

Tried re initializing cam, uninstalling and reinstalling but nothing seems to work. Camera screen appears momentarily before it crashes. No Permission dialog appears on a new install.

I also tried to recreate this app from scratch by copy & paste code modules, library and bil in a new app. Strangely, the camera started to work, but only for a short while. When I tested it again the next day it was back to crashing as before. Another attempt at such redo has not yielded positive results.

Already present in the app-
B4X:
    #PlistExtra:<key>NSPhotoLibraryUsageDescription</key><string>Select a photo.</string>
    #PlistExtra:<key>NSPhotoLibraryAddUsageDescription</key><string>Save photo in albums.</string>
    #PlistExtra:<key>NSCameraUsageDescription</key><string>Taking a photo.</string>
    #PlistExtra:<key>NSMicrophoneUsageDescription</key><string>Record video.</string>

Code it crashes at (cam.Takepicture)
B4X:
    cam.Initialize("cam", Page1)
    cam.TakePicture

Error on iPhone4s-
SignalHandler 6
Error occurred on line: 2466 (Main)
Signal - 6
Stack Trace: (
"0 GameBet SignalHandler + 112",
"1 libsystem_platform.dylib 0x1d66c251 _sigtramp + 16",
"2 libsystem_kernel.dylib 0x1d5b5dbb <redacted> + 64",
"3 libsystem_kernel.dylib 0x1d5b5df5 system_set_sfi_window + 0",
"4 TCC <redacted> + 198",
"5 TCC <redacted> + 0",
"6 TCC <redacted> + 352",
"7 libxpc.dylib <redacted> + 46",
"8 libxpc.dylib <redacted> + 26",
"9 libdispatch.dylib <redacted> + 536"

Error on iPhone6s-
SignalHandler 6
Error occurred on line: 2466 (Main)
Signal - 6
Stack Trace: (
"0 GameBet SignalHandler + 120",
"1 libsystem_platform.dylib 0x00000001a3e34884 4D8CF271-94F7-3D09-8E5E-5E462A8B3B17 + 34948",
"2 libsystem_kernel.dylib 0x00000001a3f20f24 AE4C3D7A-7D08-33E7-BCC6-11AC821B4E48 + 163620",
"3 libsystem_kernel.dylib 0x00000001a3f20f54 AE4C3D7A-7D08-33E7-BCC6-11AC821B4E48 + 163668",
"4 TCC 03E8D082-B885-3FA8-A1DA-CCB21D26FE1A + 7368",
"5 TCC 03E8D082-B885-3FA8-A1DA-CCB21D26FE1A + 7176",
"6 TCC 03E8D082-B885-3FA8-A1DA-CCB21D26FE1A + 23336",
"7 libxpc.dylib 219DEC3C-E62E-395D-8911-FB74F73A5598 + 97412",
"8 libxpc.dylib 219DEC3C-E62E-395D-8911-FB74F73A5598 + 48920",
"9 libdispatch.dylib B7EED4C7-560D-3DA6-9B50-ED52A150AAC6 + 377348"
)

Any suggestions?
 

jai

Active Member
Licensed User
Longtime User
This code works properly.

It also works fine when I add it to other apps. Except the one app it does not work in. This code worked in its past release of this app last year. A recompilation of the same old code does not work as described earlier. It does not even generate the Permission request on a new install.

Another sudden idiosyncrasy of this app in its current state is that it is the only app that would not run automatically even though the "Run installed App Automatically" is checked.
 
Upvote 0

jai

Active Member
Licensed User
Longtime User
The problem seems to stem from a file, B4iProject-Info.plist, in Files\Special subdir. This file was included in the last version released over two years ago. It contained overrides that are apparently not compatible with new library versions. Removing it solved above problems.

Thanks Erel for your guidance!
 
Last edited:
Upvote 0
Top