运行时无法执行颤振应用程序
Posted
技术标签:
【中文标题】运行时无法执行颤振应用程序【英文标题】:Can not execute flutter app when I run it 【发布时间】:2021-04-19 00:24:35 【问题描述】:当我运行颤振应用程序时,android 模拟器中没有任何反应,vscode 控制台显示此错误:
Launching lib\main.dart on Samsung Galaxy S8 in debug mode...
Running Gradle task 'assembleDebug'...
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:\Users\13\.gradle\wrapper\dists\gradle-5.6.2-all\9st6wgf78h16so49nn74lgtbb\gradle-5.6.2-all.zip
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:61)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'...
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:\Users\13\.gradle\wrapper\dists\gradle-5.6.2-all\9st6wgf78h16so49nn74lgtbb\gradle-5.6.2-all.zip
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:61)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
扑扑医生:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.19042.685], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.52.1)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
顺便说一下 dart 和 flutter 插件都安装了。
【问题讨论】:
你的安卓模拟器没有打开,因此它显示! No devices available
。
我在打开 android 模拟器时重复了多次该命令,但同样的问题。
正如它所说,你没有安装颤振和飞镖插件,这样做,check here
已经安装了。
【参考方案1】:
可能是缓存问题。请尝试以下步骤。
-
打开您的项目。
打开终端。
执行
flutter clean
命令。
执行flutter run
命令。
【讨论】:
以上是关于运行时无法执行颤振应用程序的主要内容,如果未能解决你的问题,请参考以下文章
RuntimeError: 无法对关闭的处理程序执行操作。 Django 和颤振