记录一次AS偶发异常导致的项目构建失败问题
以下是报错信息
Could not determine the dependencies of task ‘:app:mergeCeshiDebugAssets’.
Could not resolve all task dependencies for configuration ‘:app:CeshiDebugRuntimeClasspath’.
Could not resolve project :flutter.
Required by:
project :app
No matching configuration of project :flutter was found. The consumer was configured to find a runtime of a component, as well as attribute ‘com.android.build.api.attributes.BuildTypeAttr’ with value ‘debug’, attribute ‘stage’ with value ‘Ceshi’, attribute ‘org.jetbrains.kotlin.platform.type’ with value ‘androidJvm’ but:
- None of the consumable configurations have attributes.
通过排查、尝试,可以尝试一下操作:
- 将报错的对应构建文件删除(这个步骤具体需要看是否在以上报错前还有报其他错误条件,这边是还有其他报错的,删完就没再报了)
- 清一下缓存重启AS(这个步骤仅属于稳妥操作)
- 切到Flutter组件下,执行一下命令:
flutter clean
flutter pub get
- 重新构建,构建成功。
问题:flutter\bin\flutter.bat’’ finished with non-zero exit value 1
Caused by: org.gradle.process.internal.ExecException: Process ‘command ‘D:\flutter2.5.3\flutter\bin\flutter.bat’’ finished with non-zero exit value 1
不要管这个报错信息,往上翻另一个报错的日志。
Error: No named parameter with the name ‘#3’.
child: Image.asset(
^^…
/D:/fflutter/packages/flutter/lib/src/widgets/image.dart:605:3: Context: Found this candidate, but the arguments don’t match.
Image.asset(
^^^^^^^^^^^文章来源:https://www.toymoban.com/news/detail-661806.html
修复掉这个简单问题,最初的那个报错就不会继续报了。不用理会上面记录的第一个报错。文章来源地址https://www.toymoban.com/news/detail-661806.html
到了这里,关于Flutter混合项目构建问题集锦的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!