記事のディレクトリ
公式に推奨される中国の鏡: https ://flutter.dev/community/china
問題の原因が見つかった、上海交通大学のフラッターミラーが故障した、または一時的に故障した;(とにかく、今日は役に立たない)
Shanghai Jiaotong University Linux User Group
FLUTTER_STORAGE_BASE_URL: https://mirrors.sjtug.sjtu.edu.cn/
PUB_HOSTED_URL: https://dart-pub.mirrors.sjtug.sjtu.edu.cn/
公式ミラーを使用した後、flutter create flutter_cmdコマンドを実行して、アプリケーションを正常に作成します。
PUB_HOSTED_URL : https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL : https://storage.flutter-io.cn
ミラーは環境変数に設定する必要があります。
1.エラーメッセージ
コマンドラインを使用してFlutterアプリケーションを作成します。コマンドは次のとおりです。
flutter create flutter_cmd
Flutterアプリケーションを作成します。アプリケーション名はflutter_cmdです。
エラーメッセージ:
D:\002_Project\002_Android_Learn\Flutter_Cmd>flutter create flutter_cmd
Creating project flutter_cmd... androidx: true
flutter_cmd\.gitignore (created)
flutter_cmd\.idea\libraries\Dart_SDK.xml (created)
flutter_cmd\.idea\libraries\Flutter_for_Android.xml (created)
flutter_cmd\.idea\libraries\KotlinJavaRuntime.xml (created)
flutter_cmd\.idea\modules.xml (created)
flutter_cmd\.idea\runConfigurations\main_dart.xml (created)
flutter_cmd\.idea\workspace.xml (created)
flutter_cmd\.metadata (created)
flutter_cmd\android\app\build.gradle (created)
flutter_cmd\android\app\src\main\kotlin\com\example\flutter_cmd\MainActivity.kt (created)
flutter_cmd\android\build.gradle (created)
flutter_cmd\android\flutter_cmd_android.iml (created)
flutter_cmd\android\.gitignore (created)
flutter_cmd\android\app\src\debug\AndroidManifest.xml (created)
flutter_cmd\android\app\src\main\AndroidManifest.xml (created)
flutter_cmd\android\app\src\main\res\drawable\launch_background.xml (created)
flutter_cmd\android\app\src\main\res\mipmap-hdpi\ic_launcher.png (created)
flutter_cmd\android\app\src\main\res\mipmap-mdpi\ic_launcher.png (created)
flutter_cmd\android\app\src\main\res\mipmap-xhdpi\ic_launcher.png (created)
flutter_cmd\android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png (created)
flutter_cmd\android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png (created)
flutter_cmd\android\app\src\main\res\values\styles.xml (created)
flutter_cmd\android\app\src\profile\AndroidManifest.xml (created)
flutter_cmd\android\gradle\wrapper\gradle-wrapper.properties (created)
flutter_cmd\android\gradle.properties (created)
flutter_cmd\android\settings.gradle (created)
flutter_cmd\ios\Runner\AppDelegate.swift (created)
flutter_cmd\ios\Runner\Runner-Bridging-Header.h (created)
flutter_cmd\ios\Runner.xcodeproj\project.pbxproj (created)
flutter_cmd\ios\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (created)
flutter_cmd\ios\.gitignore (created)
flutter_cmd\ios\Flutter\AppFrameworkInfo.plist (created)
flutter_cmd\ios\Flutter\Debug.xcconfig (created)
flutter_cmd\ios\Flutter\Release.xcconfig (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Contents.json (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-1024x1024@1x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@1x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@2x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-20x20@3x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@1x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@2x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-29x29@3x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@1x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@2x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-40x40@3x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-60x60@2x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-60x60@3x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-76x76@1x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-76x76@2x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\AppIcon.appiconset\Icon-App-83.5x83.5@2x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\LaunchImage.imageset\Contents.json (created)
flutter_cmd\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage@2x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage@3x.png (created)
flutter_cmd\ios\Runner\Assets.xcassets\LaunchImage.imageset\README.md (created)
flutter_cmd\ios\Runner\Base.lproj\LaunchScreen.storyboard (created)
flutter_cmd\ios\Runner\Base.lproj\Main.storyboard (created)
flutter_cmd\ios\Runner\Info.plist (created)
flutter_cmd\ios\Runner.xcodeproj\project.xcworkspace\contents.xcworkspacedata (created)
flutter_cmd\ios\Runner.xcworkspace\contents.xcworkspacedata (created)
flutter_cmd\lib\main.dart (created)
flutter_cmd\flutter_cmd.iml (created)
flutter_cmd\pubspec.yaml (created)
flutter_cmd\README.md (created)
flutter_cmd\test\widget_test.dart (created)
Because flutter_cmd depends on cupertino_icons any which doesn't exist (could not find package cupertino_icons at https://storage.flutter-io.cn), version solving failed.
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Because flutter_cmd depends on cupertino_icons any which doesn't exist (could not find package cupertino_icons at https://storage.flutter-io.cn), version solving failed.
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
Because flutter_cmd depends on cupertino_icons any which doesn't exist (could not find package cupertino_icons at https://storage.flutter-io.cn), version solving failed.
pub get failed (server unavailable) -- attempting retry 3 in 4 seconds...
Because flutter_cmd depends on cupertino_icons any which doesn't exist (could not find package cupertino_icons at https://storage.flutter-io.cn), version solving failed.
pub get failed (server unavailable) -- attempting retry 4 in 8 seconds...
Running "flutter pub get" in flutter_cmd... |终止批处理操作吗(Y/N)? y
D:\002_Project\002_Android_Learn\Flutter_Cmd>
第二に、解決策
Flutterの2つのソースが正しく設定されていません。以前にこの問題が発生しましたが、ソースの障害が原因でもあります。
【错误记录】Flutter报错BITSサービスを使用したDartSDKのダウンロードに失敗し、WebRequestで再試行しました…
公式の中国のコミュニティのソースを使用して、コマンドラインの作成を完了します。
PUB_HOSTED_URL : https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL : https://storage.flutter-io.cn