GZXTaoBaoAppFlutter
GZXTaoBaoAppFlutter copied to clipboard
运行报错啊,怎么解决呢?
Compiler message: ../../.pub-cache/hosted/pub.flutter-io.cn/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, ^ ../../.pub-cache/hosted/pub.flutter-io.cn/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, ^ ../../.pub-cache/hosted/pub.flutter-io.cn/cached_network_image-0.8.0/lib/src/cached_network_image_provider.dart:42:24: Error: The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'. ImageStreamCompleter load(CachedNetworkImageProvider key) { ^ ../../flutter/packages/flutter/lib/src/painting/image_provider.dart:574:24: Context: This is the overridden method ('load'). ImageStreamCompleter load(T key, DecoderCallback decode); ^ Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
- What went wrong: A problem occurred configuring project ':connectivity'.
Could not resolve all artifacts for configuration ':connectivity:classpath'. Could not download guava.jar (com.google.guava:guava:26.0-jre) > Could not get resource 'https://jcenter.bintray.com/com/google/guava/guava/26.0-jre/guava-26.0-jre.jar'. > Read timed out Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.3.11) > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.3.11/kotlin-reflect-1.3.11.jar'. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.3.11/kotlin-reflect-1.3.11.jar'. > Received close_notify during handshake Could not download kotlin-stdlib.jar (org.jetbrains.kotlin:kotlin-stdlib:1.3.11) > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.3.11/kotlin-stdlib-1.3.11.jar'. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.3.11/kotlin-stdlib-1.3.11.jar'. > Received close_notify during handshake
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
-
Get more help at https://help.gradle.org
BUILD FAILED in 1m 26s Exception: Gradle task assembleDebug failed with exit code 1
一样 ,这个垃圾的东西 就这 都运行不起来
1.升级这两个包: dio: ^3.0.0 cached_network_image: ^2.2.0
2.把报错的几个类都注释掉 HeaderInterceptors LogsInterceptors ResponseInterceptors 3.把HttpManager里引用这3个类的地方注释掉。
就能跑了。
dio: ^3.0.0 cached_network_image: ^2.2.0
2.把报错的几个类都改下代码 return super.onxxx(xxx) HeaderInterceptors : LogsInterceptors: ResponseInterceptors