How would I go about using `AVAudioRecorder` from ...
# ios
m
How would I go about using
AVAudioRecorder
from Kotlin code? If I try to write code that accesses it, I get this linking error:
Undefined symbols for architecture x86_64: "_OBJC___CLASS_$_AVAudioRecorder", referenced from: objc-class-ref in shared(result.o)
. I checked for other people having this problem, but it seems to mostly occur with external dependencies, while to the best of my knowledge
AVAudioRecorder
should be included in the standard iOS SDK. Is it related to me running the project in a simulator on an x86_64 Mac?
l
Simulator doesn't have a camera or mic on iOS. The symbol should exist, but even so, it won't work on simulator.
m
I have found conflicting information about this on this internet, but I would at least like to be able to run the app for testing purposes. Is there a way to provide the missing symbols?
l
I'd add '-framework AVFoundation -framework AudioToolbox' to the linker flags (using cinterop). In the app, add AVFoundation.framework to the 'Link Binary with Libraries' section.