How can I find out what the Problem is? Every Time I start Audio and hear it when the iPad/iPhone is turned off and then activate Display of the device after 10-15 Minutes, the App crashes.
Here are the First Lines of the Crash Report:
Hardware Model: iPad8,12
Process: VOH-App [16336]
Path: /private/var/containers/Bundle/Application/5B2CF582-D108-4AA2-B30A-81BA510B7FB6/VOH-App.app/VOH-App
Identifier: com.voiceofhope.VOH
Version: 7 (1.0)
Code Type: ARM-64 (Native)
Role: Non UI
Parent Process: launchd [1]
Coalition: com.voiceofhope.VOH [740]
Date/Time: 2021-08-18 22:51:24.0770 +0200
Launch Time: 2021-08-18 22:36:50.4081 +0200
OS Version: iPhone OS 14.7.1 (18G82)
Release Type: User
Baseband Version: 2.05.01
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_PROTECTION_FAILURE at 0x000000016d2dffb0
VM Region Info: 0x16d2dffb0 is in 0x16d2dc000-0x16d2e0000; bytes after start: 16304 bytes before end: 79
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
CG raster data 11cad0000-11d814000 [ 13.3M] r--/r-- SM=COW
GAP OF 0x4fac8000 BYTES
---> STACK GUARD 16d2dc000-16d2e0000 [ 16K] ---/rwx SM=NUL ... for thread 0
Stack 16d2e0000-16d3dc000 [ 1008K] rw-/rwx SM=PRV thread 0
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [16336]
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libswiftCore.dylib 0x00000001a8028360 swift::MetadataCacheKey::operator==+ 3773280 (swift::MetadataCacheKey) const + 4
1 libswiftCore.dylib 0x00000001a801ab8c _swift_getGenericMetadata+ 3718028 (swift::MetadataRequest, void const* const*, swift::TargetTypeContextDescriptor<swift::InProcess> const*) + 304
2 libswiftCore.dylib 0x00000001a7ffbd00 __swift_instantiateCanonicalPrespecializedGenericMetadata + 36
Here is a full crash Report:
The Problem was a Timer in which some Actions with an Animation were executed. I solved the Problem by checking at the beginning of the timer, if the app is Active:
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification)) { _ in
data.isAppActive = false
}
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in
data.isAppActive = true
}
Timer.scheduledTimer(withTimeInterval: 0.2, repeats: true) { (_) in
guard data.isAppActive else { return }
...
}