【发布时间】:2021-08-30 11:18:37
【问题描述】:
我将包 'qr_code_scanner: ^0.5.1' 添加到我的 pubspec.yaml 中。
重启我的应用后,出现如下错误:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\qr_code_scanner-
0.5.1\android\build.gradle' line: 39
* What went wrong:
A problem occurred evaluating project ':qr_code_scanner'.
> Could not find method buildFeatures() for arguments
[build_983ew3001pu1n91tvzyoag4vc$_run_closure2$_closure7@3a00d2ee] on object of type
com.android.build.gradle.LibraryExtension.
* 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 2s
Exception: Gradle task assembleDebug failed with exit code 1
我的颤振医生:
我真的不知道是什么导致了错误。
感谢大家的回复!
【问题讨论】:
-
您可以尝试运行
flutter clean、flutter pub get,然后再次尝试构建吗? -
说实话我不知道在哪里运行这些命令。我只是将 IntelliJ 中的按钮用于
flutter pug get。那么我在哪里运行flutter clean。 -
坦克,但我仍然得到错误。
-
buildscript > dependencies下com.android.tools.build:gradle在android/build.gradle中的版本是什么?
标签: android flutter kotlin dart flutter-packages