In iPhone 6s, iPhone 8 plus and iPhone XR with iOS 14.8.1 and 15.3.1, app is crashing when click on audio button. At this time it is asking permission. I followed same as documentation and working well in remaining iOS and Android devices. Crashing in specifi devices. Here is the crash log.
Incident Identifier: F071C05E-F3FC-4DE5-8901-1B3D6E7D3CEA
Hardware Model: iPhone10,2
Process: Runner [1527]
Path: /private/var/containers/Bundle/Application/97DA3EBA-C4B5-4CE1-9240-2DE88A83F645/Runner.app/Runner
Identifier: com.myapp.app
Version: 100 (1.0)
AppStoreTools: 13E500
AppVariant: 1:iPhone10,2:14
Beta: YES
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.myapp.app [818]
Date/Time: 2022-04-15 13:39:09.4154 +0530
Launch Time: 2022-04-15 13:38:30.5858 +0530
OS Version: iPhone OS 14.8.1 (18H107)
Release Type: User
Baseband Version: 6.71.01
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x18ec88928 __exceptionPreprocess + 216 (NSException.m:199)
1 libobjc.A.dylib 0x1a2a27480 objc_exception_throw + 56 (objc-exception.mm:565)
2 CoreFoundation 0x18eb96380 +[NSException raise:format:arguments:] + 96 (NSException.m:146)
3 Foundation 0x18feceef8 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 128 (NSException.m:231)
4 Flutter 0x10463c138 -[FlutterStandardMethodCodec encodeErrorEnvelope:] + 196
5 Flutter 0x1046390d0 __45-[FlutterMethodChannel setMethodCallHandler:]block_invoke_2 + 136
6 flutter_audio_recorder2 0x103bdf3e8 $syXlSgIeyBy_ypSgIegn_TR + 160 (:0)
7 flutter_audio_recorder2 0x103bdf3e8 specialized SwiftFlutterAudioRecorder2Plugin.handle(:result:) + 7176 (SwiftFlutterAudioRecorder2Plugin.swift:93)
8 flutter_audio_recorder2 0x103bdc400 $s23flutter_audio_recorder232SwiftFlutterAudioRecorder2PluginC6handle_6resultySo0E10MethodCallC_yypSgctF015$syXlSgIeyBy_ypO7Iegn_TRyXlSgIeyBy_Tf1ncn_n + 16 (:0)
9 flutter_audio_recorder2 0x103bdc400 @objc SwiftFlutterAudioRecorder2Plugin.handle(_:result:) + 84
10 Flutter 0x104639038 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 116
11 Flutter 0x10416dd08 flutter::PlatformViewIOS::HandlePlatformMessage(std::__1::unique_ptr<flutter::PlatformMessage, std::__1::default_deleteflutter::PlatformMessage >) + 516
12 Flutter 0x1044ffcc4 std::__1::__function::__func<fml::internal::CopyableLambda<flutter::Shell::OnEngineHandlePlatformMessage(std::__1::unique_ptr<flutter::PlatformMessage, std::__1::default_delete<flutter::PlatformMes... + 92
13 Flutter 0x104427c10 fml::MessageLoopImpl::FlushTasks(fml::FlushType) + 1668
14 Flutter 0x10442b1dc fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*) + 32
15 CoreFoundation 0x18ec087a8 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 28 (CFRunLoop.c:1807)
16 CoreFoundation 0x18ec083a8 __CFRunLoopDoTimer + 1016 (CFRunLoop.c:2415)
17 CoreFoundation 0x18ec0787c __CFRunLoopDoTimers + 324 (CFRunLoop.c:2575)
18 CoreFoundation 0x18ec01bb4 __CFRunLoopRun + 1948 (CFRunLoop.c:3090)
19 CoreFoundation 0x18ec00ed0 CFRunLoopRunSpecific + 572 (CFRunLoop.c:3242)
20 GraphicsServices 0x1a534c570 GSEventRunModal + 160 (GSEvent.c:2259)
21 UIKitCore 0x19152e2d0 -[UIApplication _run] + 1052 (UIApplication.m:3269)
22 UIKitCore 0x19153384c UIApplicationMain + 164 (UIApplication.m:4740)
23 Runner 0x1029f4f38 main + 64 (AppDelegate.swift:7)
24 libdyld.dylib 0x18e8df140 start + 4
I am using flutter_audio_recorder2: ^0.0.2 and stable version of flutter (2.10.3).
I was asking NSMicrophoneUsageDescription permission also and added in info.plist file.
Please suggest me on this.
I got the exact issue. We are using .wav audio format which is not supported by some devices like iPhone 8+, iPhone XR etc. After changing to audio format as .aac, crash issue solved. Below is the line of code.