App fails to build in Xcode with incorrect parameter type for `ParseConnectivityResult`
New Issue Checklist
- [x ] I am not disclosing a vulnerability.
- [ x] I am not just asking a question.
- [ x] I have searched through existing issues.
- [ x] I can reproduce the issue with the latest version of Parse Server and the Parse Flutter SDK.
Issue Description
Cannot build flutter application with parse server plugin
Steps to reproduce
Run application build in IntelliJ IDEA
Actual Outcome
Running Xcode build...
Xcode build done. 34.8s
Failed to build iOS app
Error (Xcode): ../../.pub-cache/hosted/pub.dev/parse_server_sdk_flutter-8.0.0/lib/parse_server_sdk_flutter.dart:126:53: Error: The argument type
'ParseConnectivityResult Function(ConnectivityResult)' can't be assigned to the parameter type 'ParseConnectivityResult Function(List<ConnectivityResult>)'.
Encountered error while building for device.
Expected Outcome
Normal build and run application
Environment
Parse Flutter SDK
- SDK version:
parse_server_sdk_flutter-8.0.0 - Flutter version:
Flutter 3.22.3 • channel stable - Dart version:
Dart SDK version: 3.4.4 (stable) - Operating system version:
Mac OS Sonoma 14.5 (23F79)
Server
- Parse Server version:
6.5.4
Logs
Running Xcode build... Xcode build done. 31.4s Failed to build iOS app Error (Xcode): ../../.pub-cache/hosted/pub.dev/parse_server_sdk_flutter-8.0.0/lib/parse_server_sdk_flutter.dart:126:53: Error: The argument type 'ParseConnectivityResult Function(ConnectivityResult)' can't be assigned to the parameter type 'ParseConnectivityResult Function(List<ConnectivityResult>)'.
Could not build the application for the simulator. Error launching application on iPhone 15 Pro Max.
Thanks for opening this issue!
- 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
[ +94 ms] Failed to build iOS app [ +2 ms] Error (Xcode): [+2988 ms] ../../.pub-cache/hosted/pub.dev/parse_server_sdk_flutter-8.0.0/lib/parse_server_sdk_flutter.dart:126:53: Error: The argument type 'ParseConnectivityResult Function(ConnectivityResult)' can't be assigned to the parameter type 'ParseConnectivityResult Function(List<ConnectivityResult>)'.
[ +3 ms] Could not build the application for the simulator.
[ ] Error launching application on iPhone 15 Pro Max.
[ +3 ms] "flutter run" took 83,473ms.
[ +6 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:840:9)
[ +99 ms] ensureAnalyticsSent: 98ms [ ] Running 1 shutdown hook [ +2 ms] Shutdown hooks complete [ ] exiting with code 1
Do you have any code to share that is causing this?
It's not in the code, the code cannot compile. It's in the plugin code:
[ +96 ms] Failed to build iOS app [ +2 ms] Error (Xcode): [+1408 ms] ../../.pub-cache/hosted/pub.dev/parse_server_sdk_flutter-8.0.0/lib/parse_server_sdk_flutter.dart:126:53: Error: The argument type 'ParseConnectivityResult Function(ConnectivityResult)' can't be assigned to the parameter type 'ParseConnectivityResult Function(List<ConnectivityResult>)'.
So you are only adding the Parse SDK to a new project without any code and then this error occurs during compile time?
No, empty Flutter project works fine with just parse_server_sdk_flutter installed. I've found the problem is with connectivity_plus flutter plugin, when I'm disabling it in my project, build going normally.
Seems the also project build normally with connectivity_plus version 5.0.2, but not with the latest 6.0.4 version
@ikarelin You might look at a PR/Issue I had last summer and see if it is the root cause of your problem. There was a breaking change in connectivity_plus in 6.x and the Flutter SDK isn't compatible.
https://github.com/parse-community/Parse-SDK-Flutter/pull/1002
@ikarelin is this still a problem?
Closing as dependency has been upgraded; if issue still exists please comment and we can re-open.