我刚刚创建了一个新的flutter项目,没有添加依赖项,但我收到了此错误* 出了什么问题:评估项目':app'时发生问题。 无法初始化类com.android.build.gradle.internal.crash.插件崩溃报告器
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.8, on Microsoft Windows [Version 10.0.19043.2251], locale en-US)
Checking Android licenses is taking an unexpectedly long time...[!] Android toolchain - develop for Android devices (Android SDK versio
n 32.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.73.1)
[√] Connected device (4 available)
[√] HTTP Host Availability
'......正如你们从我的Flutter医生那里看到的,一切看起来都很好。有人能帮我一下吗,因为我真的搞不懂。谢谢。
我已经尝试升级gradle,但仍然没有得到好的结果
2条答案
按热度按时间ar7v8xwq1#
1.尝试在终端
rm -rf $HOME/.gradle/caches/
中键入以下内容以删除.gradle缓存如果错误仍然存在,请继续执行步骤21.尝试使用--scan命令,它可能是~/。android由root所有,因此您的构建(由我的用户启动)无法读取/写入此目录。
解决方案:sudo chown
-R you:you ~/.android
bprjcwpo2#
使用此命令接受您的Android许可
flutter doctor --android-licenses
之后接受所有