在flutter中添加flutter_html库时pubpspect get失败

h9vpoimq  于 2023-05-30  发布在  Flutter
关注(0)|答案(2)|浏览(208)

我尝试构建app 'flutter_html:^2.1.5”但我无法构建并获取日志中的以下错误。

The current Flutter SDK version is 1.27.0-2.0.pre.1.

Because flutter_app depends on flutter_html >=2.1.0 which requires Flutter SDK version >=2.2.0, version solving failed.
pub get failed (1; Because flutter_app depends on flutter_html >=2.1.0 which requires Flutter SDK version >=2.2.0, version solving failed.)

你能建议解决这个问题的方法吗?
我已经升级了flutter版本并迁移了,但有不同的问题。

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':app:checkDebugManifest' (type 'CheckManifest').
  - In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.internal.tasks.CheckManifest' property 'manifest' has @Input annotation used on property of type 'File'.

    Reason: A property of type 'File' annotated with @Input cannot determine how to interpret the file.

    Possible solutions:
      1. Annotate with @InputFile for regular files.
      2. Annotate with @InputDirectory for directories.
      3. If you want to track the path, return File.absolutePath as a String and keep @Input.

    Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#incorrect_use_of_input_annotation for more details about this problem.

* 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 11s
Exception: Gradle task assembleDebug failed with exit code 1
brccelvz

brccelvz1#

您需要升级Flutter SDK。在终端中写入flutter upgrade
或者使用旧版本的flutter_html

qyzbxkaa

qyzbxkaa2#

只需将以下内容添加到pubspec.yaml flutter_html:^3.0.0-α 3。

相关问题