Cannot build my App? The app can be built but crashes
Minor issue ?
Platforms you faced the error
iOS ? Ipad only, in my case I had iPadOS 15.1
Android ? No
Flutter Web ? Idk
Emulator ? No
Real device ? Ipad only
Describe the bug
When starting the recording player, it crashes on an iPad.
To Reproduce
Steps to reproduce the behavior:
Start the player with SampleRate set as 44100Hz in a stream (toFile = null) on a real device iPad.
Codec pcm16.
Logs!!!!
Stops at _startRecorder
See this: flutter: │ 🐛 ---> startRecorderCompleted: true
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0 FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:243:13)
flutter: │ #1 MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22)
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 🐛 <--- startRecorderCompleted: true
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'
*** First throw call stack:
(0x18448bc9c 0x19b63f758 0x18458491c 0x18458eb34 0x18444bb4c 0x184468edc 0x10017e104 0x10091f5f4 0x10092082c 0x1ddee19d0 0x1dde9b65c 0x1ddee08dc 0x184158198 0x1840fa550 0x18410bfb8 0x1840fdfa4 0x1840febb4 0x1840ffd20 0x184108750 0x1dd569e84 0x1dd5699f0)
libc++abi: terminating with uncaught exception of type NSException
Flutter Sound Version :
FULL or LITE flavor ? Tried with both latest version
Important: Result of the command :
flutter pub deps | grep flutter_sound
| |-- flutter_sound_lite... |-- flutter_sound_lite 8.5.0 | |-- flutter_sound_platform_interface 8.5.0 | |-- flutter_sound_web 8.5.0 | | |-- flutter_sound_platform_interface...
Severity
Crash? Yeah
Result is not what expected? Exactly it crashes
Cannot build my App? The app can be built but crashes
Minor issue ?
Platforms you faced the error
iOS ? Ipad only, in my case I had iPadOS 15.1
Android ? No
Flutter Web ? Idk
Emulator ? No
Real device ? Ipad only
Describe the bug When starting the recording player, it crashes on an iPad.
To Reproduce Steps to reproduce the behavior: Start the player with SampleRate set as 44100Hz in a stream (toFile = null) on a real device iPad. Codec pcm16.
Logs!!!!
Stops at
_startRecorder
See this: flutter: │ 🐛 ---> startRecorderCompleted: true flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:243:13) flutter: │ #1 MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22) flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ 🐛 <--- startRecorderCompleted: true flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]' *** First throw call stack: (0x18448bc9c 0x19b63f758 0x18458491c 0x18458eb34 0x18444bb4c 0x184468edc 0x10017e104 0x10091f5f4 0x10092082c 0x1ddee19d0 0x1dde9b65c 0x1ddee08dc 0x184158198 0x1840fa550 0x18410bfb8 0x1840fdfa4 0x1840febb4 0x1840ffd20 0x184108750 0x1dd569e84 0x1dd5699f0) libc++abi: terminating with uncaught exception of type NSException
__pthread_kill + 8 libsystem_kernel.dylib
__pthread_kill: -> 0x1bd2fb9e8 <+8>: b.lo 0x1bd2fba04 ; <+36> 0x1bd2fb9ec <+12>: stp x29, x30, [sp, #-0x10]! 0x1bd2fb9f0 <+16>: mov x29, sp 0x1bd2fb9f4 <+20>: bl 0x1bd2f7670 ; cerror_nocancel Target 0: (Runner) stopped.Turns out by checking this other issue: https://github.com/Canardoux/flutter_sound/issues/689 I realized I could check the default
SampleRate
and it works with 16000hz.We could definitely have a better error message for when this crashes. Also we could support 44100Hz as a sample rate on ipad 🤔
Hope this can actually save some search time for someone else.