Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目运行不起来,运行了很多别人的项目是可以的! #17

Open
sunsboyxu opened this issue Aug 19, 2020 · 2 comments
Open

Comments

@sunsboyxu
Copy link

Compiler message:
lib/pages/main/avatar_history_page.dart:157:23: Error: Method not found: 'UploadFileInfo'.
"avatar": new UploadFileInfo(new File(filePath), fileName),
^^^^^^^^^^^^^^
lib/pages/main/avatar_history_page.dart:156:24: Error: Method not found: 'FormData.from'.
params: FormData.from({
^^^^
lib/utils/file_util.dart:84:24: Error: No named parameter with the name 'connectTimeout'.
options: Options(connectTimeout: 15 * 1000, receiveTimeout: 360 * 1000),
^^^^^^^^^^^^^^
/F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/options.dart:140:2: Context: Found this candidate, but the arguments don't match.
Options({
^^^^^^^
lib/config/api_strategy.dart:139:44: Error: Method not found: 'FormData.from'.
data: formData ?? new FormData.from(params),
^^^^
lib/config/api_strategy.dart:136:61: Error: The getter 'isNotEmpty' isn't defined for the class 'FormData'.

  • 'FormData' is from 'package:dio/src/form_data.dart' ('/F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/form_data.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'isNotEmpty'.
    if (params != null && params.isNotEmpty || formData.isNotEmpty) {
    ^^^^^^^^^^
    lib/logic/avatar_page_logic.dart:115:23: Error: Method not found: 'UploadFileInfo'.
    "avatar": new UploadFileInfo(new File(filePath), fileName),
    ^^^^^^^^^^^^^^
    lib/logic/avatar_page_logic.dart:114:24: Error: Method not found: 'FormData.from'.
    params: FormData.from({
    ^^^^
    lib/logic/feedback_page_logic.dart:91:33: Error: Method not found: 'UploadFileInfo'.
    "avatar": new UploadFileInfo(new File(avatarPath), transFormName),
    ^^^^^^^^^^^^^^
    lib/logic/feedback_page_logic.dart:90:34: Error: Method not found: 'FormData.from'.
    params: FormData.from({
    ^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_svg-0.13.1/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    PictureStream();
    ^^^^^^^^^^^^^
    lib/widgets/update_progress_widget.dart:186:28: Error: No named parameter with the name 'connectTimeout'.
    },options: Options(connectTimeout: 151000,receiveTimeout: 3601000),);
    ^^^^^^^^^^^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/options.dart:140:2: Context: Found this candidate, but the arguments don't match.
    Options({
    ^^^^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_svg-0.13.1/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    abstract class PictureStreamCompleter extends Diagnosticable {
    ^

Compiler message:
lib/pages/main/avatar_history_page.dart:157:23: Error: Method not found: 'UploadFileInfo'.
"avatar": new UploadFileInfo(new File(filePath), fileName),
^^^^^^^^^^^^^^
lib/pages/main/avatar_history_page.dart:156:24: Error: Method not found: 'FormData.from'.
params: FormData.from({
^^^^
lib/utils/file_util.dart:84:24: Error: No named parameter with the name 'connectTimeout'.
options: Options(connectTimeout: 15 * 1000, receiveTimeout: 360 * 1000),
^^^^^^^^^^^^^^
/F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/options.dart:140:2: Context: Found this candidate, but the arguments don't match.
Options({
^^^^^^^
lib/config/api_strategy.dart:139:44: Error: Method not found: 'FormData.from'.
data: formData ?? new FormData.from(params),
^^^^
lib/config/api_strategy.dart:136:61: Error: The getter 'isNotEmpty' isn't defined for the class 'FormData'.

  • 'FormData' is from 'package:dio/src/form_data.dart' ('/F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/form_data.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'isNotEmpty'.
    if (params != null && params.isNotEmpty || formData.isNotEmpty) {
    ^^^^^^^^^^
    lib/logic/avatar_page_logic.dart:115:23: Error: Method not found: 'UploadFileInfo'.
    "avatar": new UploadFileInfo(new File(filePath), fileName),
    ^^^^^^^^^^^^^^
    lib/logic/avatar_page_logic.dart:114:24: Error: Method not found: 'FormData.from'.
    params: FormData.from({
    ^^^^
    lib/logic/feedback_page_logic.dart:91:33: Error: Method not found: 'UploadFileInfo'.
    "avatar": new UploadFileInfo(new File(avatarPath), transFormName),
    ^^^^^^^^^^^^^^
    lib/logic/feedback_page_logic.dart:90:34: Error: Method not found: 'FormData.from'.
    params: FormData.from({
    ^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_svg-0.13.1/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    PictureStream();
    ^^^^^^^^^^^^^
    lib/widgets/update_progress_widget.dart:186:28: Error: No named parameter with the name 'connectTimeout'.
    },options: Options(connectTimeout: 151000,receiveTimeout: 3601000),);
    ^^^^^^^^^^^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/options.dart:140:2: Context: Found this candidate, but the arguments don't match.
    Options({
    ^^^^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_svg-0.13.1/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    abstract class PictureStreamCompleter extends Diagnosticable {
    ^
    Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
    build failed.

FAILURE: Build failed with an exception.

  • Where:
    Script 'F:\install\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'F:\install\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • 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 16s
Exception: Gradle task assembleDebug failed with exit code 1

@nightfallsad
Copy link

Compiler message:
lib/pages/main/avatar_history_page.dart:157:23: Error: Method not found: 'UploadFileInfo'.
"avatar": new UploadFileInfo(new File(filePath), fileName),
^^^^^^^^^^^^^^
lib/pages/main/avatar_history_page.dart:156:24: Error: Method not found: 'FormData.from'.
params: FormData.from({
^^^^
lib/utils/file_util.dart:84:24: Error: No named parameter with the name 'connectTimeout'.
options: Options(connectTimeout: 15 * 1000, receiveTimeout: 360 * 1000),
^^^^^^^^^^^^^^
/F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/options.dart:140:2: Context: Found this candidate, but the arguments don't match.
Options({
^^^^^^^
lib/config/api_strategy.dart:139:44: Error: Method not found: 'FormData.from'.
data: formData ?? new FormData.from(params),
^^^^
lib/config/api_strategy.dart:136:61: Error: The getter 'isNotEmpty' isn't defined for the class 'FormData'.

  • 'FormData' is from 'package:dio/src/form_data.dart' ('/F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/form_data.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'isNotEmpty'.
    if (params != null && params.isNotEmpty || formData.isNotEmpty) {
    ^^^^^^^^^^
    lib/logic/avatar_page_logic.dart:115:23: Error: Method not found: 'UploadFileInfo'.
    "avatar": new UploadFileInfo(new File(filePath), fileName),
    ^^^^^^^^^^^^^^
    lib/logic/avatar_page_logic.dart:114:24: Error: Method not found: 'FormData.from'.
    params: FormData.from({
    ^^^^
    lib/logic/feedback_page_logic.dart:91:33: Error: Method not found: 'UploadFileInfo'.
    "avatar": new UploadFileInfo(new File(avatarPath), transFormName),
    ^^^^^^^^^^^^^^
    lib/logic/feedback_page_logic.dart:90:34: Error: Method not found: 'FormData.from'.
    params: FormData.from({
    ^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_svg-0.13.1/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    PictureStream();
    ^^^^^^^^^^^^^
    lib/widgets/update_progress_widget.dart:186:28: Error: No named parameter with the name 'connectTimeout'.
    },options: Options(connectTimeout: 15_1000,receiveTimeout: 360_1000),);
    ^^^^^^^^^^^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/options.dart:140:2: Context: Found this candidate, but the arguments don't match.
    Options({
    ^^^^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_svg-0.13.1/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    abstract class PictureStreamCompleter extends Diagnosticable {
    ^

Compiler message:
lib/pages/main/avatar_history_page.dart:157:23: Error: Method not found: 'UploadFileInfo'.
"avatar": new UploadFileInfo(new File(filePath), fileName),
^^^^^^^^^^^^^^
lib/pages/main/avatar_history_page.dart:156:24: Error: Method not found: 'FormData.from'.
params: FormData.from({
^^^^
lib/utils/file_util.dart:84:24: Error: No named parameter with the name 'connectTimeout'.
options: Options(connectTimeout: 15 * 1000, receiveTimeout: 360 * 1000),
^^^^^^^^^^^^^^
/F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/options.dart:140:2: Context: Found this candidate, but the arguments don't match.
Options({
^^^^^^^
lib/config/api_strategy.dart:139:44: Error: Method not found: 'FormData.from'.
data: formData ?? new FormData.from(params),
^^^^
lib/config/api_strategy.dart:136:61: Error: The getter 'isNotEmpty' isn't defined for the class 'FormData'.

  • 'FormData' is from 'package:dio/src/form_data.dart' ('/F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/form_data.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'isNotEmpty'.
    if (params != null && params.isNotEmpty || formData.isNotEmpty) {
    ^^^^^^^^^^
    lib/logic/avatar_page_logic.dart:115:23: Error: Method not found: 'UploadFileInfo'.
    "avatar": new UploadFileInfo(new File(filePath), fileName),
    ^^^^^^^^^^^^^^
    lib/logic/avatar_page_logic.dart:114:24: Error: Method not found: 'FormData.from'.
    params: FormData.from({
    ^^^^
    lib/logic/feedback_page_logic.dart:91:33: Error: Method not found: 'UploadFileInfo'.
    "avatar": new UploadFileInfo(new File(avatarPath), transFormName),
    ^^^^^^^^^^^^^^
    lib/logic/feedback_page_logic.dart:90:34: Error: Method not found: 'FormData.from'.
    params: FormData.from({
    ^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_svg-0.13.1/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    PictureStream();
    ^^^^^^^^^^^^^
    lib/widgets/update_progress_widget.dart:186:28: Error: No named parameter with the name 'connectTimeout'.
    },options: Options(connectTimeout: 15_1000,receiveTimeout: 360_1000),);
    ^^^^^^^^^^^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10/lib/src/options.dart:140:2: Context: Found this candidate, but the arguments don't match.
    Options({
    ^^^^^^^
    /F:/install/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_svg-0.13.1/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    abstract class PictureStreamCompleter extends Diagnosticable {
    ^
    Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
    build failed.

FAILURE: Build failed with an exception.

  • Where:
    Script 'F:\install\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882
  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'F:\install\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • 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 16s
Exception: Gradle task assembleDebug failed with exit code 1

dio版本问题吧

@asjqkkkk
Copy link
Owner

我对一些配置做了修改,可以拉以下最新代码,目前应该是可以运行的
以下是我目前的配置:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.3 19D76, locale zh-Hans-CN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.43.1)
[!] Connected device

! Doctor found issues in 1 category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants