简体   繁体   English

Flutter 应用程序卡在“应用程序运行 gradle 任务 'assembledebug...”

[英]Flutter App stuck on "app running gradle task 'assembledebug..."

This is my first flutter app I tried running the sample given by the flutter but it gets stuck on this message app running gradle task 'assembledebug.... or after sometime error Exception: Gradle task assembleDebug failed with exit code 1 appears. This is my first flutter app I tried running the sample given by the flutter but it gets stuck on this message app running gradle task 'assembledebug.... or after sometime error Exception: Gradle task assembleDebug failed with exit code 1 appears. Tried doing all the things answered in similar questions.尝试做类似问题中回答的所有事情。 Using sdk version 30, Android studio ver 3.1 and flutter ver 1.20.1.使用 sdk 版本 30、Android studio 版本 3.1 和 flutter 版本 1.20.1。

> Failed to transform artifact 'x86_debug.jar (io.flutter:x86_debug:1.0.0-c8e3b9485386425213e2973126d6f57e7ed83c54)' to match attributes {artifactType=android-classes, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JetifyTransform: C:\Users\dell\.gradle\caches\modules-2\files-2.1\io.flutter\x86_debug\1.0.0-c8e3b9485386425213e2973126d6f57e7ed83c54\570a59b7be41f73458509975d3eefca7ad5561cf\x86_debug-1.0.0-c8e3b9485386425213e2973126d6f57e7ed83c54.jar.
         > Failed to transform 'C:\Users\dell\.gradle\caches\modules-2\files-2.1\io.flutter\x86_debug\1.0.0-c8e3b9485386425213e2973126d6f57e7ed83c54\570a59b7be41f73458509975d3eefca7ad5561cf\x86_debug-1.0.0-c8e3b9485386425213e2973126d6f57e7ed83c54.jar' using Jetifier. Reason: Unexpected end of ZLIB input stream. (Run with --stacktrace for more details.)

* 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

have you tried a clean build with flutter clean ?您是否尝试过使用flutter clean进行干净构建? and could you also post more of your error and code?您还可以发布更多错误和代码吗?

Try to empty cache "C:\Users\dell.gradle\caches" and re-run the project.尝试清空缓存“C:\Users\dell.gradle\caches”并重新运行项目。 You should also check for Event log error when building the project.您还应该在构建项目时检查事件日志错误。

In your android studio, cd to android directory then run from terminal: gradlew clean gradlew build and then run the application.在您的 android 工作室中,cd 到 android 目录,然后从终端运行: gradlew clean gradlew build 然后运行应用程序。 If it wont work try flutter clean.如果它不起作用,请尝试清洁 flutter。 Also delete the.gradle folder in Users directory.同时删除Users目录下的.gradle文件夹。 it will take some time but it will run.这将需要一些时间,但它会运行。

Run

flutter run -v

so you can see which part is taking much time.所以你可以看到哪个部分花费了很多时间。 In my case it was Downloading https://services.gradle.org/distributions/gradle-7.4-all.zip if you have the same problem check this在我的情况下,它正在Downloading https://services.gradle.org/distributions/gradle-7.4-all.zip如果你有同样的问题检查这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter / Android / Gradle - 任务:app:compileDebugKotlin FAILED - Flutter / Android / Gradle - Task :app:compileDebugKotlin FAILED 在vscode中运行flutter应用程序时gradle出错 - Having error in gradle in running flutter app in vscode 运行gradle任务时在应用程序中获取jvm参数 - get jvm argument in the app when running gradle task Gradle 任务 assembleDebug 失败,退出代码 1 错误? - Gradle task assembleDebug failed with exit code 1 ERROR? flutter:Gradle 在尝试自我更新时抛出错误。 正在重试更新... Gradle 任务 assembleDebug 失败,退出代码为 1 - flutter : Gradle threw an error while trying to update itself. Retrying the update… Gradle task assembleDebug failed with exit code 1 gradle 任务 ':app:compileDebugJavaWithJavac' 出错 - Error on gradle task ':app:compileDebugJavaWithJavac' Gradle 任务 assembleDebug 失败,退出代码为 1(运行时异常) - Gradle task assembleDebug failed with exit code 1 (Runtime Exception) 错误:Gradle:任务执行失败':app:preDexDebug' - Error: Gradle: execution failed for task ':app:preDexDebug' Gradle错误:任务':app:dexDebug'的执行失败。 - Gradle Error:Execution failed for task ':app:dexDebug'. gradle 构建时出现异常(任务:'app:mergeDebugResources') - Exception while gradle build (Task: 'app:mergeDebugResources')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM