Parse-SDK-Flutter icon indicating copy to clipboard operation
Parse-SDK-Flutter copied to clipboard

App fails to build in Xcode with incorrect parameter type for `ParseConnectivityResult`

Open ikarelin opened this issue 1 year ago • 8 comments

New Issue Checklist

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.

ikarelin avatar Aug 01 '24 19:08 ikarelin

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) #2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1394:27) #3 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #4 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #5 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9) #6 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5) #8 run.. (package:flutter_tools/runner.dart:130:9) #9 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #10 main (package:flutter_tools/executable.dart:93:3)

[ +99 ms] ensureAnalyticsSent: 98ms [ ] Running 1 shutdown hook [ +2 ms] Shutdown hooks complete [ ] exiting with code 1

ikarelin avatar Aug 02 '24 11:08 ikarelin

Do you have any code to share that is causing this?

mtrezza avatar Aug 02 '24 22:08 mtrezza

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>)'.

ikarelin avatar Aug 03 '24 10:08 ikarelin

So you are only adding the Parse SDK to a new project without any code and then this error occurs during compile time?

mtrezza avatar Aug 03 '24 14:08 mtrezza

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.

ikarelin avatar Aug 04 '24 13:08 ikarelin

Seems the also project build normally with connectivity_plus version 5.0.2, but not with the latest 6.0.4 version

ikarelin avatar Aug 04 '24 13:08 ikarelin

@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

chadpav avatar Oct 17 '24 13:10 chadpav

@ikarelin is this still a problem?

kirkmorrow avatar Dec 03 '25 22:12 kirkmorrow

Closing as dependency has been upgraded; if issue still exists please comment and we can re-open.

mtrezza avatar Dec 03 '25 23:12 mtrezza