自从我将Flutter从v1.9.1 + hotfix.2升级到v1.14.7-pre.113以来,我在编译应用程序时遇到了问题。我已经上网了几天,却找不到任何遇到相同问题的人。我真的不知道出什么问题,而且似乎也找不到任何东西,我希望遇到此问题的人可能知道出了什么问题。
这是我在调试控制台中遇到的错误:
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
Check Element Visible
Open Browser
... url=https://www.google.com
... browser=chrome
${passed} Run Keyword And Return Status
... Element Should Be Visible xpath://*[@id="hplogo"]
Run Keyword If ${passed} Keyword Passed
... ELSE Keyword Failed
[Teardown] Close Browser
Check Element Not Visible
Open Browser
... url=https://www.google.com
... browser=chrome
${passed} Run Keyword And Return Status
... Element Should Be Visible xpath://*[@id="xxxx"]
Run Keyword If ${passed} Keyword Passed
... ELSE Keyword Failed
[Teardown] Close Browser
*** Keywords ***
Keyword Passed
Log To Console Passed
Keyword Failed
Log To Console Failed
这是我的pubspec.yaml:
Compiler message:
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage_image-0.4.0/lib/firebase_storage_image.dart:54:24: Error: The method 'FirebaseStorageImage.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.
ImageStreamCompleter load(FirebaseStorageImage key) =>
^
/C:/src/flutter/packages/flutter/lib/src/painting/image_provider.dart:489:24: Context: This is the overridden method ('load').
ImageStreamCompleter load(T key, DecoderCallback decode);
^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 803
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\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 40s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
答案 0 :(得分:0)
您应该看到Flutter的新版本需要Gridel。因此,最好使用新版本的Flutter创建一个新项目,然后在build.gradle,gradle-wrapper.properties和gradle.properties文件中查看对项目进行了哪些更改。
并使用 flutter clean
。
答案 1 :(得分:0)
我知道已经有一段时间了,但我为那些遇到这个问题的人发布了这个答案
您只需要将 image_provider
和 firebase_storage_image
升级到更新的版本
从 pub.dev 并运行 pub get