Giter Site home page Giter Site logo

Comments (6)

shinayser avatar shinayser commented on July 1, 2024 7

I was able to make it running by changing my podfile as that:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.2' 
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

from speech_recognition.

ROTGP avatar ROTGP commented on July 1, 2024 3

Just to follow up... my errors above were because I wasn't using Swift 4.2 (which requires XCode 10). The syntax used in this package is specific to Swift 4.2.... compiling with 4.1 won't work. Also, the Podfile requires:
config.build_settings['SWIFT_VERSION'] = '4.2'
just below the 'ENABLE_BITCODE' line, and also:
use_frameworks!
just below
target 'Runner' do

This was all very painful to figure out for myself... perhaps the readme should make it clear?

from speech_recognition.

mcconkiee avatar mcconkiee commented on July 1, 2024 1

ok.... Here's how i fixed this:

  1. remove the dependency and get flutter app to compile as was before installing speech_recognition
  2. In XCode, update the target to latest Swift Syntax (apparently, needs to be 4.2?)
  3. add back the dependency to pubspec.yml in flutter app
  4. in the SwiftSpeechRecognitionPlugin.swift file, change line 111 (see old commented line)
let audioSession = AVAudioSession.sharedInstance()
    try audioSession.setCategory(AVAudioSession.Category.record, mode: .default)
    try audioSession.setMode(AVAudioSession.Mode.measurement)
//    try audioSession.setActive(true, with: .notifyOthersOnDeactivation)
    try audioSession.setActive(true, options: .notifyOthersOnDeactivation)

i'd PR this, but don't have the time right now. Just making a note here.

from speech_recognition.

rxlabz avatar rxlabz commented on July 1, 2024 1

sorry I did not realized that 4.2 was available for XCode10 only. I updated the README.

from speech_recognition.

ROTGP avatar ROTGP commented on July 1, 2024

I'm having a similar issue... @mcconkiee 's fix didn't work for me.

`Launching lib/main.dart on iPhone 7 in debug mode...
Xcode build done. 1.3s
Failed to build iOS app
Error output from Xcode build:

** BUILD FAILED **
Xcode's output:

=== BUILD TARGET speech_recognition OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/Downloads/speech_recognition-master/ios/Classes/SwiftSpeechRecognitionPlugin.swift:186:76: error: 'Category' is not a member type of 'AVAudioSession'
fileprivate func convertFromAVAudioSessionCategory(_ input: AVAudioSession.Category) -> String {


try audioSession.setCategory(AVAudioSession.Category.record, mode: .default)
^~~~~~~~~~~~~~ ~~~~~~~~
AVFoundation.AVAudioSession:23:14: note: did you mean 'category'?
open var category: String { get }
^
/Users/Downloads/speech_recognition-master/ios/Classes/SwiftSpeechRecognitionPlugin.swift:112:30: error: type 'AVAudioSession' has no member 'Mode'
try audioSession.setMode(AVAudioSession.Mode.measurement)
^~~~~~~~~~~~~~ ~~~~
AVFoundation.AVAudioSession:33:14: note: did you mean 'mode'?
open var mode: String { get }
^
ObjectiveC.NSObject:160:15: note: did you mean 'zone'?
open func zone() -> NSZone!
^
ObjectiveC.NSObject:162:21: note: did you mean 'zone'?
open class func zone() -> NSZone!
^
/Users/Downloads/speech_recognition-master/ios/Classes/SwiftSpeechRecognitionPlugin.swift:114:48: error: extra argument 'options' in call
try audioSession.setActive(true, options: .notifyOthersOnDeactivation)
~^~~~~~~~~~~~~~~~~~~~~~~~~~
Could not build the application for the simulator.
Error launching application on iPhone 7.
Exited (sigterm)
`

from speech_recognition.

namnh06 avatar namnh06 commented on July 1, 2024

sorry I did not realized that 4.2 was available for XCode10 only. I updated the README.

I still dont see the config on the README man. Still struggle on this one, fix follow @ROTGP & @shinayser but no luck.
When I ran debug, this is showing:

Installing speech_recognition (0.3.0)
- Running pre install hooks
[!] Unable to determine Swift version for the following pods:
- speech_recognition does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

from speech_recognition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.