每次我在android studio x1c 0d1x中打开我的项目时,我都会收到此错误
- Flutter医生-v
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19042.1415], locale en-US)
• Flutter version 2.8.1 at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (11 days ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\adria\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.61.2)
• VS Code at C:\Users\adria\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (3 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.45
• Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.62
• No issues found!
我已经尝试过flutter clean、flutter升级、重置我的笔记本电脑并在www.example.com中进行了更改gradle.properties
org.gradle.jvmargs=-Xmx1536M => org.gradle.jvmargs=-Xmx1024M
我使用模拟器设备,但现在从android studio我不能运行应用程序,因为他们不出现在我
我也不能在android studio中运行命令,如flutter doctor、flutter clean、pub get、flutter upgrade,我只能在终端上运行
3条答案
按热度按时间qco9c6ql1#
这是一个有点老,但我已经看到了类似的问题时,试图加载一个项目从外部驱动器,或者如果我已经访问了相同的项目从Mac和PC安装的Android Studio.
这似乎是一个与flutter SDK的位置相关的问题,Android Studio会“忘记”正确的位置。我看到过路径被删除或更改的问题,这可能会导致这个问题(我还看到dart SDK的路径也被删除了)。
进入首选项/设置,将flutter sdk位置更改为正确的安装位置(如果需要,dart sdk也是如此)似乎解决了这个问题(至少对我来说)。我想说的是,这可能是Android Studio中的一个bug。
3pvhb19x2#
现在再次启动Emulator。
ghhkc1vu3#
我遇到了完全相同问题,并通过运行
然后再