figengungor/country_pickers

Package Issues

MishalJasmine opened this issue · 4 comments

The Web app was working fine but all of a sudden its throwing the below errors:

> Launching lib\main.dart on Chrome in release mode...
Target dart2js failed: Exception: /C:/flutter/.pub-cache/hosted/pub.dartlang.org/country_pickers-1.3.0/lib/country_picker_dropdown.dart:151:7:
Error: No named parameter with the name 'onTap'.
      onTap: widget.onTap,
      ^^^^^
/C:/flutter/packages/flutter/lib/src/material/dropdown.dart:782:3:
Info: Found this candidate, but the arguments don't match.
  DropdownButton({
  ^^^^^^^^^^^^^^
Error: Compilation failed.
Compiling lib\main.dart for the Web...                             26.2s
Exception: Failed to compile application for the Web.

On using flutter channel beta, this is what I get

> Switching to flutter channel 'beta'...
git: error: cannot lock ref 'refs/remotes/origin/Hixie-patch-1': unable to resolve reference 'refs/remotes/origin/Hixie-patch-1': reference broken
git: From https://github.com/flutter/flutter
git:  ! [new branch]            Hixie-patch-1    -> origin/Hixie-patch-1  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/beta': unable to resolve reference 'refs/remotes/origin/beta': reference broken
git:  ! [new branch]            beta             -> origin/beta  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/dart_development_service': unable to resolve reference 'refs/remotes/origin/dart_development_service': reference broken
git:  ! [new branch]            dart_development_service -> origin/dart_development_service  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/dev': unable to resolve reference 'refs/remotes/origin/dev': reference broken
git:  ! [new branch]            dev              -> origin/dev  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.17-candidate.3': unable to resolve reference 'refs/remotes/origin/flutter-1.17-candidate.3': reference broken
git:  ! [new branch]            flutter-1.17-candidate.3 -> origin/flutter-1.17-candidate.3  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.18-candidate.10': unable to resolve reference 'refs/remotes/origin/flutter-1.18-candidate.10': reference broken
git:  ! [new branch]            flutter-1.18-candidate.10 -> origin/flutter-1.18-candidate.10  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.18-candidate.11': unable to resolve reference 'refs/remotes/origin/flutter-1.18-candidate.11': reference broken
git:  ! [new branch]            flutter-1.18-candidate.11 -> origin/flutter-1.18-candidate.11  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.18-candidate.12': unable to resolve reference 'refs/remotes/origin/flutter-1.18-candidate.12': reference broken
git:  ! [new branch]            flutter-1.18-candidate.12 -> origin/flutter-1.18-candidate.12  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.18-candidate.13': unable to resolve reference 'refs/remotes/origin/flutter-1.18-candidate.13': reference broken
git:  ! [new branch]            flutter-1.18-candidate.13 -> origin/flutter-1.18-candidate.13  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.18-candidate.6': unable to resolve reference 'refs/remotes/origin/flutter-1.18-candidate.6': reference broken
git:  ! [new branch]            flutter-1.18-candidate.6 -> origin/flutter-1.18-candidate.6  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.18-candidate.7': unable to resolve reference 'refs/remotes/origin/flutter-1.18-candidate.7': reference broken
git:  ! [new branch]            flutter-1.18-candidate.7 -> origin/flutter-1.18-candidate.7  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.18-candidate.8': unable to resolve reference 'refs/remotes/origin/flutter-1.18-candidate.8': reference broken
git:  ! [new branch]            flutter-1.18-candidate.8 -> origin/flutter-1.18-candidate.8  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.18-candidate.9': unable to resolve reference 'refs/remotes/origin/flutter-1.18-candidate.9': reference broken
git:  ! [new branch]            flutter-1.18-candidate.9 -> origin/flutter-1.18-candidate.9  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.19-candidate.0': unable to resolve reference 'refs/remotes/origin/flutter-1.19-candidate.0': reference broken
git:  ! [new branch]            flutter-1.19-candidate.0 -> origin/flutter-1.19-candidate.0  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/flutter-1.19-candidate.1': unable to resolve reference 'refs/remotes/origin/flutter-1.19-candidate.1': reference broken
git:  ! [new branch]            flutter-1.19-candidate.1 -> origin/flutter-1.19-candidate.1  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/guidezpl-patch-1': unable to resolve reference 'refs/remotes/origin/guidezpl-patch-1': reference broken
git:  ! [new branch]            guidezpl-patch-1 -> origin/guidezpl-patch-1  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/master': unable to resolve reference 'refs/remotes/origin/master': reference broken
git:  ! [new branch]            master           -> origin/master  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/revert-51465-fab-complete-new': unable to resolve reference 'refs/remotes/origin/revert-51465-fab-complete-new': reference broken
git:  ! [new branch]            revert-51465-fab-complete-new -> origin/revert-51465-fab-complete-new  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/roll_branch': unable to resolve reference 'refs/remotes/origin/roll_branch': reference broken
git:  ! [new branch]            roll_branch      -> origin/roll_branch  (unable to update local ref)
git: error: cannot lock ref 'refs/remotes/origin/stable': unable to resolve reference 'refs/remotes/origin/stable': reference broken
git:  ! [new branch]            stable           -> origin/stable  (unable to update local ref)
Switching channels failed with error code 1.

On `flutter run --verbose` ,

> [  +43 ms] executing: [C:\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +75 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] 2294d75bfa8d067ba90230c0fc2268f3636d7584
[   +1 ms] executing: [C:\flutter/] git fetch https://github.com/flutter/flutter.git --tags
[+4489 ms] Exit code 0 from: git fetch https://github.com/flutter/flutter.git --tags
[   +2 ms] From https://github.com/flutter/flutter
            * branch                  HEAD       -> FETCH_HEAD
[        ] executing: [C:\flutter/] git describe --match v*.*.* --first-parent --long --tags
[  +57 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.15.17-0-g2294d75bfa
[  +21 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +38 ms] Exit code 128 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] fatal: HEAD does not point to a branch
[  +18 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref HEAD
[  +38 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] HEAD
[  +35 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +7 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +37 ms] executing: C:\Users\Sony\AppData\Local\Android\Sdk\platform-tools\adb.exe devices -l
[  +25 ms] Exit code 0 from: C:\Users\Sony\AppData\Local\Android\Sdk\platform-tools\adb.exe devices -l
[        ] List of devices attached
[  +13 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[  +12 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +75 ms] More than one device connected; please specify a device with the '-d <deviceId>' flag, or use '-d all' to act on all devices.
[  +42 ms] Chrome     • chrome     • web-javascript • Google Chrome 81.0.4044.138
[   +7 ms] Web Server • web-server • web-javascript • Flutter Tools
[  +13 ms] "flutter run" took 312ms.
0      throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1      RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:332:7) <asynchronous suspension>

> #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:691:11)
<asynchronous suspension>

> #3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:609:33)

<asynchronous suspension>

> #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart)
#5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#6      _rootRun (dart:async/zone.dart:1126:13)
#7      _CustomZone.run (dart:async/zone.dart:1023:19)
#8      _runZoned (dart:async/zone.dart:1518:10)
#9      runZoned (dart:async/zone.dart:1465:12)
#10     AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#11     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:599:20)
#12     CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#13     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:338:21)
<asynchronous suspension>

> #14     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart)

> #15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#16     _rootRun (dart:async/zone.dart:1126:13)
#17     _CustomZone.run (dart:async/zone.dart:1023:19)
#18     _runZoned (dart:async/zone.dart:1518:10)
#19     runZoned (dart:async/zone.dart:1465:12)
#20     AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#21     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:288:19)
#22     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#23     new Future.sync (dart:async/future.dart:224:31)
#24     CommandRunner.run (package:args/command_runner.dart:112:14)
#25     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:231:18)
#26     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:63:22)
#27     _rootRun (dart:async/zone.dart:1126:13)
#28     _CustomZone.run (dart:async/zone.dart:1023:19)
#29     _runZoned (dart:async/zone.dart:1518:10)
#30     runZoned (dart:async/zone.dart:1502:12)
#31     run.<anonymous closure> (package:flutter_tools/runner.dart:61:18)
<asynchronous suspension>

> #32     run.<anonymous closure> (package:flutter_tools/runner.dart)
#33     runInContext.runnerWrapper (package:flutter_tools/src/context_runner.dart:69:18)
<asynchronous suspension>

> #34`     runInContext.runnerWrapper (package:flutter_tools/src/context_runner.dart)
#35     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#36     _rootRun (dart:async/zone.dart:1126:13)
#37     _CustomZone.run (dart:async/zone.dart:1023:19)
#38     _runZoned (dart:async/zone.dart:1518:10)
#39     runZoned (dart:async/zone.dart:1465:12)
#40     AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#41     runInContext (package:flutter_tools/src/context_runner.dart:72:24)
#42     run (package:flutter_tools/runner.dart:50:10)
<asynchronous suspension>

> #43     main (package:flutter_tools/executable.dart:69:9)
#44     main (file:///C:/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#45     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#46     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Can you please help me to fix this.

Have a look at here : #34

Pomis commented

Maybe it would be better to add sdk constraint to library? Having the same issue on 1.8.1 flutter version. Can't quickly upgrade version because it is a huge and old project with a lot of functionality that will break after update

I was able to remove the error. I changed the version of flutter_form_builder to 3.7.3. This error was observed with other newer versions of the package.

My project is using flutter version 1.12.13 hotfix 9 and we don't plan to upgrade flutter version now.
So I created this fork and removed the lines causing that issue.

Feel free to use it,
https://github.com/shadyshrif/country_pickers_backward_support

I'm using dependency_overrides to force flutter to use this version for the other packages that depends on it like flutter_form_builder

dependency_overrides:
  country_pickers :
    git:
      url: git://github.com/shadyshrif/country_pickers_backward_support