gpt4 book ai didi

android - 每当我尝试运行我的 Flutter 程序时,它都会卡在 “Running Gradle task ' assembleDebug”

转载 作者:行者123 更新时间:2023-12-04 23:58:00 24 4
gpt4 key购买 nike

每当我尝试在模拟器或真实设备上运行时,它都会卡在 “Running Gradle task 'assembleDebug” 并且整个计算机只是卡住并卡住,唯一的方法out 是硬重启它。

我使用的是华硕笔记本电脑(Windows 10),内存为 16GB。

flutter --version 给出:(当我尝试 flutter upgrade 它给出相同的结果并说我有最新版本)

Flutter 1.20.0-1.0.pre.42 • channel master • https://github.com/flutter/flutter.git
Framework • revision 401690a64f (2 days ago) • 2020-06-12 19:45:48 -0700
Engine • revision 965fbbed17
Tools • Dart 2.9.0 (build 2.9.0-14.0.dev 2b917f5b6a)

当我运行 flutter doctor 时,我在终端中得到了这个输出:UPDATED

   C:\Users\Lidor>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.20.0-1.0.pre.42, on Microsoft Windows [Version 10.0.18362.900], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 4.0)
[√] IntelliJ IDEA Community Edition (version 2019.2)
[!] Connected device
! No devices available

! Doctor found issues in 1 category.

当我运行 flutter doctor -v 时,我得到了这个输出:

C:\Users\Lidor>flutter doctor -v
[√] Flutter (Channel master, 1.20.0-1.0.pre.42, on Microsoft Windows [Version 10.0.18362.900], locale en-US)
• Flutter version 1.20.0-1.0.pre.42 at D:\Study\P.Languages\Flutter\flutter_windows_v1.7.8+hotfix.4-stable\flutter
• Framework revision 401690a64f (2 days ago), 2020-06-12 19:45:48 -0700
• Engine revision 965fbbed17
• Dart version 2.9.0 (build 2.9.0-14.0.dev 2b917f5b6a)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at D:\Lidor\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: D:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit
https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.

[√] Android Studio (version 4.0)
• Android Studio at D:\Program Files\Android\Android Studio
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] IntelliJ IDEA Community Edition (version 2019.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2
• Flutter plugin version 38.1.4
• Dart plugin version 192.5728.98

[!] Connected device
! No devices available

! Doctor found issues in 2 categories.

我还尝试按照它的建议运行 flutter channel master here还有一切here

最佳答案

发生这种情况的原因有很多:不接受 android 许可证、sdk/flutter 版本不兼容、Windows 防火墙等。

如果你还没有尝试过:

更新文件 android/app/build.gradle

compileSdkVersion 29

运行: flutter 干净

否则检查Flutter App stuck at "Running Gradle task 'assembleDebug'... "

或者如果您的 Android 许可证状态未知。

Android Studio installs without sdkmanager取消选中 Hide Obsolete Packages,您将看到 Android SDK Tools (Obsolete) 26.1.1。然后 flutter doctor --android-licenses

关于android - 每当我尝试运行我的 Flutter 程序时,它都会卡在 “Running Gradle task ' assembleDebug”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62388023/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com