FlutterRadioPlayer icon indicating copy to clipboard operation
FlutterRadioPlayer copied to clipboard

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

Open bastengao opened this issue 2 years ago • 9 comments

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

bastengao avatar Jan 26 '23 09:01 bastengao

where did you get the 2.2.0 version of this package?

edit: nevermind, it says 2.0.0 in the stacktrace.

markfili avatar Jan 26 '23 09:01 markfili

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.

bastengao avatar Jan 26 '23 10:01 bastengao

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

markfili avatar Jan 28 '23 10:01 markfili

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. 👍

bastengao avatar Jan 30 '23 13:01 bastengao

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?

markfili avatar Jan 31 '23 07:01 markfili

@markfili metadata works too.

bastengao avatar Jan 31 '23 08:01 bastengao

@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 😄

markfili avatar Jan 31 '23 08:01 markfili

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<AVMetadataItem>) -> ()' to expected argument type '(AudioPlayer.MetadataEventData) -> Void' (aka '(Array<AVTimedMetadataGroup>) -> ()') /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.

devmgs avatar May 28 '23 06:05 devmgs

the same error, is there any news?

rapiz avatar Oct 10 '23 12:10 rapiz