florent37 / Flutter-AssetsAudioPlayer

Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications
https://pub.dartlang.org/packages/assets_audio_player
Apache License 2.0
755 stars 361 forks source link

macOS build error #508

Open oliverchu opened 3 years ago

oliverchu commented 3 years ago

Flutter Version

My version :

Flutter 2.0.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4d7946a68d (2 weeks ago) • 2021-03-18 17:24:33 -0700
Engine • revision 3459eb2436
Tools • Dart 2.12.2

Lib Version

My version : assets_audio_player: ^3.0.3+2

Platform (Android / iOS / web) + version

Platform : macOS: 11.2.3 (20D91)

Describe the bug

flutter build -d macOS

Launching lib/main.dart on macOS in debug mode...
/Users/oliver/Dev/flutter/.pub-cache/hosted/pub.flutter-io.cn/assets_audio_player-3.0.3+2/darwin/Classes/Music.swift:612:25: warning: initialization of variable 'error' was never used; consider replacing with assignment to '_' or removing it
                    var error = item.error                              
                    ~~~~^~~~~                                           
                    _                                                   
/Users/oliver/Dev/flutter/.pub-cache/hosted/pub.flutter-io.cn/assets_audio_player-3.0.3+2/darwin/Classes/Music.swift:833:26: error: 'playImmediately(atRate:)' is only available in macOS 10.12 or newer
            self.player?.playImmediately(atRate: self.rate)             
                         ^                                              
/Users/oliver/Dev/flutter/.pub-cache/hosted/pub.flutter-io.cn/assets_audio_player-3.0.3+2/darwin/Classes/Music.swift:833:26: note: add 'if #available' version check
            self.player?.playImmediately(atRate: self.rate)             
                         ^                                              
/Users/oliver/Dev/flutter/.pub-cache/hosted/pub.flutter-io.cn/assets_audio_player-3.0.3+2/darwin/Classes/Music.swift:831:10: note: add @available attribute to enclosing instance method
    func play(){                                                        
         ^                                                              
/Users/oliver/Dev/flutter/.pub-cache/hosted/pub.flutter-io.cn/assets_audio_player-3.0.3+2/darwin/Classes/Music.swift:100:14: note: add @available attribute to enclosing class
public class Player : NSObject, AVAudioPlayerDelegate {                 
             ^                                                          
note: Using new build system                                            
note: Building targets in parallel                                      
note: Planning build                                                    
note: Constructing build description                                    
** BUILD FAILED ** 
kobeumut commented 3 years ago

I have the same error.

xni06 commented 3 years ago

Same here.

[✓] Flutter (Channel stable, 2.0.3, on macOS 11.2.3 20D91 darwin-x64, locale en-GB) • Flutter version 2.0.3 at /Users/rhisiart/flutter • Framework revision 4d7946a68d (4 weeks ago), 2021-03-18 17:24:33 -0700 • Engine revision 3459eb2436 • Dart version 2.12.2

[✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.4, Build version 12D4e • CocoaPods version 1.10.1

[✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 11.2.3 20D91 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.72

TobiasHeidingsfeld commented 3 years ago

Same here

hzlgnn commented 3 years ago

Same

chaeMil commented 2 years ago

same here

hzlgnn commented 2 years ago

Hello,

Have you found any solution here?