当我尝试运行 Flutter Doctor -v 时,我得到了这些
[√] Flutter (Channel stable, 2.2.3, on Windows, locale en-US)
• Flutter version 2.2.3 at C:\src\flutter
• Framework revision f4abaa0735 (2 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\CCS\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Program Files\Java\jdk-16.0.1\bin\java
• Java version Java(TM) SE Runtime Environment (build 16.0.1+9-24)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[√] VS Code, 64-bit edition (version 1.58.0)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.24.0
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.124
• Edge (web) • edge • web-javascript • Microsoft Edge 91.0.864.67
! Doctor found issues in 1 category.
除了它显示安装在我的 PC 中的 Android Studio(未安装)之外,这很好 当我运行 flutter create project_name 我得到
Creating project projectname...
projectname\.gitignore (created)
projectname\.idea\libraries\Dart_SDK.xml (created)
projectname\.idea\libraries\KotlinJavaRuntime.xml (created)
projectname\.idea\modules.xml (created)
projectname\.idea\runConfigurations\main_dart.xml (created)
projectname\.idea\workspace.xml (created)
projectname\.metadata (created)
projectname\android\app\build.gradle (created)
projectname\android\app\src\main\kotlin\com\example\projectname\MainActivity.kt (created)
projectname\android\build.gradle (created)
projectname\android\projectname_android.iml (created)
projectname\android\.gitignore (created)
projectname\android\app\src\debug\AndroidManifest.xml (created)
projectname\android\app\src\main\AndroidManifest.xml (created)
projectname\android\app\src\main\res\drawable\launch_background.xml (created)
projectname\android\app\src\main\res\drawable-v21\launch_background.xml (created)
projectname\android\app\src\main\res\mipmap-hdpi\ic_launcher.png (created)
projectname\android\app\src\main\res\mipmap-mdpi\ic_launcher.png (created)
projectname\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png (created)
projectname\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png (created)
projectname\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png (created)
projectname\android\app\src\main\res\values\styles.xml (created)
projectname\android\app\src\main\res\values-night\styles.xml (created)
projectname\android\app\src\profile\AndroidManifest.xml (created)
projectname\android\gradle\wrapper\gradle-wrapper.properties (created)
projectname\android\gradle.properties (created)
projectname\android\settings.gradle (created)
projectname\ios\Runner\AppDelegate.swift (created)
projectname\ios\Runner\Runner-Bridging-Header.h (created)
projectname\ios\Runner.xcodeproj\project.pbxproj (created)
projectname\ios\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (created)
projectname\ios\.gitignore (created)
projectname\ios\Flutter\AppFrameworkInfo.plist (created)
projectname\ios\Flutter\Debug.xcconfig (created)
projectname\ios\Flutter\Release.xcconfig (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Contents.json (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-1024x1024@1x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@1x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@2x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@3x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@1x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@2x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@3x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@1x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@2x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@3x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-60x60@2x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-60x60@3x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-76x76@1x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-76x76@2x.png (created)
projectname\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-83.5x83.5@2x.png (created)
projectname\ios\Runner\Assets.xcassets\LaunchImage.imageset\Contents.json (created)
projectname\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage.png (created)
projectname\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage@2x.png (created)
projectname\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage@3x.png (created)
projectname\ios\Runner\Assets.xcassets\LaunchImage.imageset\README.md (created)
projectname\ios\Runner\Base.lproj\LaunchScreen.storyboard (created)
projectname\ios\Runner\Base.lproj\Main.storyboard (created)
projectname\ios\Runner\Info.plist (created)
projectname\ios\Runner.xcodeproj\project.xcworkspace\contents.xcworkspacedata (created)
projectname\ios\Runner.xcodeproj\project.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (created)
projectname\ios\Runner.xcodeproj\project.xcworkspace\xcshareddata\WorkspaceSettings.xcsettings (created)
projectname\ios\Runner.xcworkspace\contents.xcworkspacedata (created)
projectname\ios\Runner.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (created)
projectname\ios\Runner.xcworkspace\xcshareddata\WorkspaceSettings.xcsettings (created)
projectname\lib\main.dart (created)
projectname\projectname.iml (created)
projectname\pubspec.yaml (created)
projectname\README.md (created)
projectname\test\widget_test.dart (created)
projectname\web\favicon.png (created)
projectname\web\icons\Icon-192.png (created)
projectname\web\icons\Icon-512.png (created)
projectname\web\index.html (created)
projectname\web\manifest.json (created)
Running "flutter pub get" in projectname...
pub get failed (1; no message)
那么我该如何解决问题发布失败(1;没有消息)
我尝试了 YouTube、GitHub 问题和其他网站的提示来解决问题,但仍然没有 我什至尝试了其他 StackOverflow 问题中有关该问题的一些答案,但仍然一无所获。
答案 0 :(得分:0)
根据文档,你可以运行“flutter config --android-studio-dir”来设置Android Studio的安装目录
答案 1 :(得分:0)
试试这个对我有用
flutter 配置 --android-studio-dir="C:\ProgramFiles\Android\Android Studio"
运行代码后检查 flutter doctor