gpt4 book ai didi

android-studio - 无法运行 'Pub get'并且无法构建Flutter项目

转载 作者:行者123 更新时间:2023-12-03 05:23:31 27 4
gpt4 key购买 nike

在Android Studio上,我克隆this flutter project。当提示是否要为下载的源创建项目时,单击否。然后单击“打开现有项目”,然后选择刚刚下载的项目。
Android Studio告诉我“Pub get尚未运行”。所以我点击“获取依赖”:

C:\src\flutter\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in dicee-flutter2... 3,0s
Process finished with exit code 0
此后,代码中的突出显示已得到纠正,因此我想项目现在可以识别抖动了。但是“Pub get尚未运行”提示永远不会消失。
然后运行我的项目,以便在虚拟设备中看到它,但是出现以下错误:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
--output directory is required for assemble.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 Doctor的输出为:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.20.0-3.0.pre.78, on Microsoft Windows [versão 10.0.18362.356], locale pt-BR)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[√] Android Studio (version 4.0)
[√] Connected device (1 available)

• No issues found!

如何解决该问题,以便我可以在虚拟设备上看到项目并停止获取“Pub get has not been run”提示?

最佳答案

AS中有一项设置可以设置输出目录。从内存中它在文件中|项目设置菜单。
这可能是发布问题的另一个问题。
您可以从项目根目录中的cli运行flutter pub get。

关于android-studio - 无法运行 'Pub get'并且无法构建Flutter项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62628740/

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