Sithira / FlutterRadioPlayer

Flutter Radio Player, A Plugin to handle streaming audio without a hassle
BSD 3-Clause "New" or "Revised" License
137 stars 63 forks source link

Swift Compiler Error (Xcode): Cannot convert value of type #79

Open bastengao opened 1 year ago

bastengao commented 1 year ago

Flutter 3.3.10, flutter_radio_player: 2.0.0

Launching lib/main.dart on iPhone 13 in debug mode...
Running Xcode build...
Xcode build done.                                           10.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/qs/jk5lkxd10dv6bb9ftq6y_xbh0000gn/T/flutter_tools.nifLdR/flutter_ios_build_temp_dirI9HhER/temporary_xcresult_bundle

    /Users/bastengao/dev/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-2.0.0/ios/Classes/core/services/FRPCoreService.swift:50:78: error: cannot convert value of type
    '(Array<AVMetadataItem>) -> ()' to expected argument type '(AudioPlayer.MetadataEventData) -> Void' (aka '(Array<AVTimedMetadataGroup>) -> ()')
            player.event.receiveMetadata.addListener(self, FRPPlayerEventHandler.handleMetaDataChanges)
                                                                                 ^
    /Users/bastengao/dev/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-2.0.0/ios/Classes/core/services/FRPCoreService.swift:50:78: note: arguments to generic parameter 'Element'
    ('AVTimedMetadataGroup' and 'AVMetadataItem') are expected to be equal
            player.event.receiveMetadata.addListener(self, FRPPlayerEventHandler.handleMetaDataChanges)
                                                                                 ^
    note: Building targets in dependency order
    warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it
    to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it
    to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')

    Result bundle written to path:
        /var/folders/qs/jk5lkxd10dv6bb9ftq6y_xbh0000gn/T/flutter_tools.nifLdR/flutter_ios_build_temp_dirI9HhER/temporary_xcresult_bundle

Swift Compiler Error (Xcode): Cannot convert value of type '(Array<AVMetadataItem>) -> ()' to expected argument type '(AudioPlayer.MetadataEventData) -> Void' (aka '(Array<AVTimedMetadataGroup>) -> ()')
/Users/bastengao/dev/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_radio_player-2.0.0/ios/Classes/core/services/FRPCoreService.swift:49:77
markfili commented 1 year ago

where did you get the 2.2.0 version of this package?

edit: nevermind, it says 2.0.0 in the stacktrace.

bastengao commented 1 year ago

where did you get the 2.2.0 version of this package?

edit: nevermind, it says 2.0.0 in the stacktrace.

Sorry, it's 2.0.0 actually.

markfili commented 1 year ago

Hey,@bastengao can you try adding this version - https://github.com/Sithira/FlutterRadioPlayer/pull/78 - to your app and see if it still breaks? I think I've fixed the issue you've reported

bastengao commented 1 year ago

Hey,@bastengao can you try adding this version - #78 - to your app and see if it still breaks? I think I've fixed the issue you've reported

Yeah, it works. 👍

markfili commented 1 year ago

Hey,@bastengao can you try adding this version - #78 - to your app and see if it still breaks? I think I've fixed the issue you've reported

Yeah, it works. 👍

great, one more thing if you have time: do you use metadata? can you confirm it works if you do?

bastengao commented 1 year ago

@markfili metadata works too.

markfili commented 1 year ago

@markfili metadata works too.

beautiful, thank you. now if we could only get @Sithira to visit us and say what he thinks about all this 😄

devmgs commented 1 year ago

getting error: flutter_radio_player: ^2.0.2

[✓] Flutter (Channel stable, 3.10.2, on macOS 13.4 22F66 darwin-arm64, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 14.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.2) [✓] Connected device (3 available) [✓] Network resources

Swift Compiler Error (Xcode): Cannot convert value of type '(Array) -> ()' to expected argument type '(AudioPlayer.MetadataEventData) -> Void' (aka '(Array) -> ()') /Users/<>/.pub-cache/hosted/pub.dev/flutter_radio_player-2.0.2/ios/Classes/core/services/FRPCoreService.swift:49:77

Could not build the application for the simulator. Error launching application on iPhone 14 Pro Max.

rapiz commented 11 months ago

the same error, is there any news?