Dio: The method 'DioHttpHeaders.add' has fewer named arguments than those of overridden method 'HttpHeaders.add'.

Created on 11 May 2020  Â·  8Comments  Â·  Source: flutterchina/dio

New Issue Checklist

I have searched a similar issue, and found only a closed one, so I preferred to start a new one

Platform Name - Flutter
Platform Version - Flutter 1.17.0
Dio Version - Tested with 2.0.22 and 3.0.9
Android Studio Version - Tested with 3.5.1 and 3.5.3
Repro rate - 100%
Repro with demo proj : Cannot launch Demo proj, but from a different error
Demo Project Link : https://drive.google.com/file/d/1PO88kXPPSi_mY5wGJJW6NRq-AfLYqI-p/view?usp=sharing

Issue Description and Steps

In Dio Example, the following error pops, cannot test for mine
D:\downloads\dio-3.0.9\example\flutter_example\android\app\src\debug\AndroidManifest.xml Error:

    Overlay manifest:package attribute declared at AndroidManifest.xml:2:5-48 value=(club.flutterchina.flutter_example)
    has a different value=(club.flutterchina.flutterexample) declared in main manifest at AndroidManifest.xml:2:5-47
    Suggestion: remove the overlay declaration at AndroidManifest.xml   and place it in the build.gradle:
        flavorName {
            applicationId = "club.flutterchina.flutter_example"
        } 

In my program (Demo Project), following error pops :

Compiler message:

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/dio-2.2.2/lib/src/dio_http_headers.dart:55:8: Error: The method 'DioHttpHeaders.add' has fewer named arguments than those of overridden method 'HttpHeaders.add'.
  void add(String name, value) {
       ^
org-dartlang-sdk:///third_party/dart/sdk/lib/_http/http.dart:694:8: Context: This is the overridden method ('add').
  void add(String name, Object value,
       ^

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/dio-2.2.2/lib/src/dio_http_headers.dart:70:8: Error: The method 'DioHttpHeaders.set' has fewer named arguments than those of overridden method 'HttpHeaders.set'.
void set(String name, Object value) {
^
org-dartlang-sdk:///third_party/dart/sdk/lib/_http/http.dart:703:8: Context: This is the overridden method ('set').
void set(String name, Object value,
^

stale

Most helpful comment

Updating the version to 3.0.9 solved the problem.

All 8 comments

I also meet this problem.
Flutter: 1.17.0
Dio: 2.2.2
Xcode 11.4.1
💦


Updating Dio to 3.0.9 and Dart to 2.8.1(stable) solved this problem. Of course, don't forget to modify your code to clean build error. And then, you can run flutter build xxxx.

Updating the version to 3.0.9 solved the problem.

when we use dio:2.1.13.
Compiler message:
../../../SoftwareInstalled/flutter/.pub-cache/hosted/pub.dartlang.org/dio-2.1.13/lib/src/dio_http_headers.dart:55:8: Error: The method 'DioHttpHeaders.add' has fewer named arguments than those of overridden method 'HttpHeaders.add'.
void add(String name, value) {
^
org-dartlang-sdk:///third_party/dart/sdk/lib/_http/http.dart:694:8: Context: This is the overridden method ('add').
void add(String name, Object value,
^
../../../SoftwareInstalled/flutter/.pub-cache/hosted/pub.dartlang.org/dio-2.1.13/lib/src/dio_http_headers.dart:70:8: Error: The method 'DioHttpHeaders.set' has fewer named arguments than those of overridden method 'HttpHeaders.set'.
void set(String name, Object value) {
^
org-dartlang-sdk:///third_party/dart/sdk/lib/_http/http.dart:703:8: Context: This is the overridden method ('set').
void set(String name, Object value,

Updating the version to 3.0.9. This worked for me.

Updating the version to 3.0.9. This worked for me.

what version 3.0.9 please help me -----
this is latest issue

/B:/flutter_windows_1.17.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/dio-2.2.2/lib/src/dio_http_headers.dart:70:8: Error: The method 'DioHttpHeaders.set' has fewer named arguments than those of overridden method 'HttpHeaders.set'.
void set(String name, Object value) {

@devendra1988 In your pubspec.yaml , update the version of dio package to 3.0.9

Tha ks dear

On Fri, Jun 19, 2020, 2:56 PM Taha Ali notifications@github.com wrote:

@devendra1988 https://github.com/devendra1988 In your pubspec.yaml ,
update the version of dio package to 3.0.9

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/flutterchina/dio/issues/780#issuecomment-646534125,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGC6VAWILGHRDJLQKNLQKW3RXMVLZANCNFSM4M6EBTLA
.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings