Closed iNima closed 4 years ago
hi @iNima , thanks a lot ! I just added this config(swift_version = 4.0), please let me know if this works for you. Latest version is 0.4.5
Hi @nikli2009 , thanks for your prompt update.
Yes, now the pod install is done correctly without any error but when I'm building the app it is not successful and shows these two errors:
/Users/iNima/.pub-cache/hosted/pub.dartlang.org/flutter_audio_recorder-0.4.5/ios/Classes/SwiftFlutterAudioRecorderPlugin.swift:69:108: error: 'AVAudioSessionCategoryOptions' has been renamed to 'AVAudioSession.CategoryOptions'
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, with: AVAudioSessionCategoryOptions.defaultToSpeaker)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AVAudioSession.CategoryOptions
AVFoundation.AVAudioSessionCategoryOptions:2:18: note: 'AVAudioSessionCategoryOptions' was obsoleted in Swift 4.2
public typealias AVAudioSessionCategoryOptions = AVAudioSession.CategoryOptions
^
/Users/iNima/.pub-cache/hosted/pub.dartlang.org/flutter_audio_recorder-0.4.5/ios/Classes/SwiftFlutterAudioRecorderPlugin.swift:153:68: error: cannot call value of non-function type 'AVAudioSession.RecordPermission'
switch AVAudioSession.sharedInstance().recordPermission(){
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
The first one is related to the Swift version. The latest Swift version of my app is 4.2 by the way but I don't know why that error happened. Maybe using the deprecated AVAudioSessionCategoryOptions
is not supported in 4.2 anymore and it is not backward compatible!
Thanks for all the details information :) @iNima my apology for the late response. I added some swift version specific code to help Xcode to compile for swift 4.2 below and 4.2 above. Hope this can resolve this issue. ;) Latest version is 0.4.7
Just in case it doesn't work, pls try
Great! Thanks @nikli2009
It works correctly now.
There is only one minor issue which is the version of the plugin in the flutter_audio_recorder.podspec
which is still 0.4.5
instead of 0.4.7
.
https://github.com/shadow-app/flutter_audio_recorder/blob/8b3b58e55ce61e8de7ae5a8eb8e93653a9f06e26/ios/flutter_audio_recorder.podspec#L6
It is not an impediment by the way. The only drawback of it is showing an incorrect version in Podfile.lock
and Manifest.lock
.
Haha my mistake, just updated it in 0.4.8
. @iNima
Going to close this issue as It's working for you now. ;)
Hi there and thanks for sharing this plugin with the community.
I'd like to use this plugin in both iOS and Android but when I run
pod install
for the iOS I receive this error:I think you need to add the
SWIFT_VERSION
in yourpodspec
file. For example, the currentSWIFT_VERSION
in my app is 4.2Could you please check this and modify your code?