Ian Hickson | 449f4a6 | 2019-11-27 15:04:02 -0800 | [diff] [blame] | 1 | // Copyright 2014 The Flutter Authors. All rights reserved. |
liyuqian | dd5559a | 2019-02-26 17:38:21 -0800 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 5 | import 'context.dart'; |
Zachary Anderson | 6f0ed5e | 2020-05-06 08:15:39 -0700 | [diff] [blame] | 6 | import 'platform.dart'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 7 | |
Jonah Williams | 0acd3e6 | 2019-04-25 15:51:08 -0700 | [diff] [blame] | 8 | UserMessages get userMessages => context.get<UserMessages>(); |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 9 | |
| 10 | /// Class containing message strings that can be produced by Flutter tools. |
| 11 | class UserMessages { |
James D. Lin | b7fd24a | 2020-04-28 10:34:03 -0700 | [diff] [blame] | 12 | // Messages used in multiple components. |
| 13 | String get flutterToolBugInstructions => |
| 14 | 'Please report a bug at https://github.com/flutter/flutter/issues.'; |
| 15 | |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 16 | // Messages used in FlutterValidator |
| 17 | String flutterStatusInfo(String channel, String version, String os, String locale) => |
Jenn Magder | d40699a | 2020-04-27 15:48:22 -0700 | [diff] [blame] | 18 | 'Channel ${channel ?? 'unknown'}, ${version ?? 'Unknown'}, on $os, locale $locale'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 19 | String flutterVersion(String version, String flutterRoot) => |
| 20 | 'Flutter version $version at $flutterRoot'; |
| 21 | String flutterRevision(String revision, String age, String date) => |
| 22 | 'Framework revision $revision ($age), $date'; |
| 23 | String engineRevision(String revision) => 'Engine revision $revision'; |
| 24 | String dartRevision(String revision) => 'Dart version $revision'; |
Jenn Magder | 4ecb1bb | 2020-05-11 11:57:02 -0700 | [diff] [blame] | 25 | String pubMirrorURL(String url) => 'Pub download mirror $url'; |
| 26 | String flutterMirrorURL(String url) => 'Flutter download mirror $url'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 27 | String get flutterBinariesDoNotRun => |
| 28 | 'Downloaded executables cannot execute on host.\n' |
| 29 | 'See https://github.com/flutter/flutter/issues/6207 for more information'; |
| 30 | String get flutterBinariesLinuxRepairCommands => |
| 31 | 'On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6\n' |
| 32 | 'On Fedora: dnf install libstdc++.i686\n' |
Wai Hon Law | e8d968e | 2019-04-05 07:55:29 -0700 | [diff] [blame] | 33 | 'On Arch: pacman -S lib32-gcc-libs'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 34 | |
| 35 | // Messages used in NoIdeValidator |
| 36 | String get noIdeStatusInfo => 'No supported IDEs installed'; |
| 37 | String get noIdeInstallationInfo => 'IntelliJ - https://www.jetbrains.com/idea/'; |
| 38 | |
| 39 | // Messages used in IntellijValidator |
| 40 | String intellijStatusInfo(String version) => 'version $version'; |
| 41 | String get intellijPluginInfo => |
| 42 | 'For information about installing plugins, see\n' |
Tim Sneath | 5291897 | 2019-04-05 11:39:30 -0700 | [diff] [blame] | 43 | 'https://flutter.dev/intellij-setup/#installing-the-plugins'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 44 | String intellijMinimumVersion(String minVersion) => |
| 45 | 'This install is older than the minimum recommended version of $minVersion.'; |
| 46 | String intellijLocation(String installPath) => 'IntelliJ at $installPath'; |
| 47 | |
| 48 | // Message used in IntellijValidatorOnMac |
| 49 | String get intellijMacUnknownResult => 'Cannot determine if IntelliJ is installed'; |
| 50 | |
| 51 | // Messages used in DeviceValidator |
| 52 | String get devicesMissing => 'No devices available'; |
| 53 | String devicesAvailable(int devices) => '$devices available'; |
| 54 | |
| 55 | // Messages used in AndroidValidator |
| 56 | String androidCantRunJavaBinary(String javaBinary) => 'Cannot execute $javaBinary to determine the version'; |
| 57 | String get androidUnknownJavaVersion => 'Could not determine java version'; |
| 58 | String androidJavaVersion(String javaVersion) => 'Java version $javaVersion'; |
Efthymis Sarmpanis | c5b3b3a | 2019-10-30 19:40:27 +0200 | [diff] [blame] | 59 | String androidJavaMinimumVersion(String javaVersion) => 'Java version $javaVersion is older than the minimum recommended version of 1.8'; |
Dan Field | 15f2119 | 2019-02-23 09:56:57 -0800 | [diff] [blame] | 60 | String androidSdkLicenseOnly(String envKey) => |
| 61 | 'Android SDK contains licenses only.\n' |
| 62 | 'Your first build of an Android application will take longer than usual, ' |
| 63 | 'while gradle downloads the missing components. This functionality will ' |
| 64 | 'only work if the licenses in the licenses folder in $envKey are valid.\n' |
| 65 | 'If the Android SDK has been installed to another location, set $envKey to that location.\n' |
| 66 | 'You may also want to add it to your PATH environment variable.\n\n' |
| 67 | 'Certain features, such as `flutter emulators` and `flutter devices`, will ' |
| 68 | 'not work without the currently missing SDK components.'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 69 | String androidBadSdkDir(String envKey, String homeDir) => |
| 70 | '$envKey = $homeDir\n' |
| 71 | 'but Android SDK not found at this location.'; |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 72 | String androidMissingSdkInstructions(String envKey, Platform platform) => |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 73 | 'Unable to locate Android SDK.\n' |
| 74 | 'Install Android Studio from: https://developer.android.com/studio/index.html\n' |
| 75 | 'On first launch it will assist you in installing the Android SDK components.\n' |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 76 | '(or visit ${_androidSdkInstallUrl(platform)} for detailed instructions).\n' |
Dan Field | 15f2119 | 2019-02-23 09:56:57 -0800 | [diff] [blame] | 77 | 'If the Android SDK has been installed to a custom location, set $envKey to that location.\n' |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 78 | 'You may also want to add it to your PATH environment variable.\n'; |
| 79 | String androidSdkLocation(String directory) => 'Android SDK at $directory'; |
| 80 | String androidSdkPlatformToolsVersion(String platform, String tools) => |
| 81 | 'Platform $platform, build-tools $tools'; |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 82 | String androidSdkInstallHelp(Platform platform) => |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 83 | 'Try re-installing or updating your Android SDK,\n' |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 84 | 'visit ${_androidSdkInstallUrl(platform)} for detailed instructions.'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 85 | // Also occurs in AndroidLicenseValidator |
| 86 | String androidStatusInfo(String version) => 'Android SDK version $version'; |
| 87 | |
| 88 | // Messages used in AndroidLicenseValidator |
| 89 | String get androidMissingJdk => |
| 90 | 'No Java Development Kit (JDK) found; You must have the environment ' |
| 91 | 'variable JAVA_HOME set and the java binary in your PATH. ' |
| 92 | 'You can download the JDK from https://www.oracle.com/technetwork/java/javase/downloads/.'; |
| 93 | String androidJdkLocation(String location) => 'Java binary at: $location'; |
| 94 | String get androidLicensesAll => 'All Android licenses accepted.'; |
| 95 | String get androidLicensesSome => 'Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses'; |
| 96 | String get androidLicensesNone => 'Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses'; |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 97 | String androidLicensesUnknown(Platform platform) => |
Dan Field | 15f2119 | 2019-02-23 09:56:57 -0800 | [diff] [blame] | 98 | 'Android license status unknown.\n' |
Otokaze | a821bdb | 2020-07-21 17:21:03 +0800 | [diff] [blame] | 99 | 'Run `flutter doctor --android-licenses` to accept the SDK licenses.\n' |
| 100 | 'See ${_androidSdkInstallUrl(platform)} for more details.'; |
Dan Field | 19b8d2e | 2019-01-23 15:56:48 -0800 | [diff] [blame] | 101 | String androidSdkManagerOutdated(String managerPath) => |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 102 | 'A newer version of the Android SDK is required. To update, run:\n' |
| 103 | '$managerPath --update\n'; |
| 104 | String androidLicensesTimeout(String managerPath) => 'Intentionally killing $managerPath'; |
| 105 | String get androidSdkShort => 'Unable to locate Android SDK.'; |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 106 | String androidMissingSdkManager(String sdkManagerPath, Platform platform) => |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 107 | 'Android sdkmanager tool not found ($sdkManagerPath).\n' |
| 108 | 'Try re-installing or updating your Android SDK,\n' |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 109 | 'visit ${_androidSdkInstallUrl(platform)} for detailed instructions.'; |
| 110 | String androidCannotRunSdkManager(String sdkManagerPath, String error, Platform platform) => |
Zachary Anderson | a5d23d2 | 2019-07-30 08:19:58 -0700 | [diff] [blame] | 111 | 'Android sdkmanager tool was found, but failed to run ($sdkManagerPath): "$error".\n' |
| 112 | 'Try re-installing or updating your Android SDK,\n' |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 113 | 'visit ${_androidSdkInstallUrl(platform)} for detailed instructions.'; |
| 114 | String androidSdkBuildToolsOutdated(String managerPath, int sdkMinVersion, String buildToolsMinVersion, Platform platform) => |
Dan Field | 19b8d2e | 2019-01-23 15:56:48 -0800 | [diff] [blame] | 115 | 'Flutter requires Android SDK $sdkMinVersion and the Android BuildTools $buildToolsMinVersion\n' |
| 116 | 'To update using sdkmanager, run:\n' |
Christian Wenz | 428d104 | 2019-03-15 16:58:33 +0100 | [diff] [blame] | 117 | ' "$managerPath" "platforms;android-$sdkMinVersion" "build-tools;$buildToolsMinVersion"\n' |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 118 | 'or visit ${_androidSdkInstallUrl(platform)} for detailed instructions.'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 119 | |
| 120 | // Messages used in AndroidStudioValidator |
| 121 | String androidStudioVersion(String version) => 'version $version'; |
| 122 | String androidStudioLocation(String location) => 'Android Studio at $location'; |
| 123 | String get androidStudioNeedsUpdate => 'Try updating or re-installing Android Studio.'; |
| 124 | String get androidStudioResetDir => |
| 125 | 'Consider removing your android-studio-dir setting by running:\n' |
| 126 | 'flutter config --android-studio-dir='; |
Dan Field | df465c7 | 2019-03-07 10:45:29 -0800 | [diff] [blame] | 127 | String get aaptNotFound => |
| 128 | 'Could not locate aapt. Please ensure you have the Android buildtools installed.'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 129 | |
| 130 | // Messages used in NoAndroidStudioValidator |
| 131 | String androidStudioMissing(String location) => |
| 132 | 'android-studio-dir = $location\n' |
| 133 | 'but Android Studio not found at this location.'; |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 134 | String androidStudioInstallation(Platform platform) => |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 135 | 'Android Studio not found; download from https://developer.android.com/studio/index.html\n' |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 136 | '(or visit ${_androidSdkInstallUrl(platform)} for detailed instructions).'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 137 | |
stuartmorgan | 81c38b2 | 2019-05-24 22:51:02 -0400 | [diff] [blame] | 138 | // Messages used in XcodeValidator |
| 139 | String xcodeLocation(String location) => 'Xcode at $location'; |
Jenn Magder | 4fba774 | 2020-07-14 17:16:02 -0700 | [diff] [blame] | 140 | String xcodeOutdated(int versionMajor, int versionMinor, int versionPatch) => |
| 141 | 'Flutter requires a minimum Xcode version of $versionMajor.$versionMinor.$versionPatch.\n' |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 142 | 'Download the latest version or update via the Mac App Store.'; |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 143 | String get xcodeEula => "Xcode end user license agreement not signed; open Xcode or run the command 'sudo xcodebuild -license'."; |
stuartmorgan | 81c38b2 | 2019-05-24 22:51:02 -0400 | [diff] [blame] | 144 | String get xcodeMissingSimct => |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 145 | 'Xcode requires additional components to be installed in order to run.\n' |
Jenn Magder | 55530d9 | 2019-11-14 10:45:47 -0800 | [diff] [blame] | 146 | 'Launch Xcode and install additional required components when prompted or run:\n' |
| 147 | ' sudo xcodebuild -runFirstLaunch'; |
stuartmorgan | 81c38b2 | 2019-05-24 22:51:02 -0400 | [diff] [blame] | 148 | String get xcodeMissing => |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 149 | 'Xcode not installed; this is necessary for iOS development.\n' |
| 150 | 'Download at https://developer.apple.com/xcode/download/.'; |
stuartmorgan | 81c38b2 | 2019-05-24 22:51:02 -0400 | [diff] [blame] | 151 | String get xcodeIncomplete => |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 152 | 'Xcode installation is incomplete; a full installation is necessary for iOS development.\n' |
| 153 | 'Download at: https://developer.apple.com/xcode/download/\n' |
| 154 | 'Or install Xcode via the App Store.\n' |
| 155 | 'Once installed, run:\n' |
Jenn Magder | 55530d9 | 2019-11-14 10:45:47 -0800 | [diff] [blame] | 156 | ' sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer\n' |
| 157 | ' sudo xcodebuild -runFirstLaunch'; |
stuartmorgan | 81c38b2 | 2019-05-24 22:51:02 -0400 | [diff] [blame] | 158 | |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 159 | // Messages used in CocoaPodsValidator |
| 160 | String cocoaPodsVersion(String version) => 'CocoaPods version $version'; |
| 161 | String cocoaPodsUninitialized(String consequence) => |
| 162 | 'CocoaPods installed but not initialized.\n' |
| 163 | '$consequence\n' |
| 164 | 'To initialize CocoaPods, run:\n' |
| 165 | ' pod setup\n' |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 166 | "once to finalize CocoaPods' installation."; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 167 | String cocoaPodsMissing(String consequence, String installInstructions) => |
| 168 | 'CocoaPods not installed.\n' |
| 169 | '$consequence\n' |
| 170 | 'To install:\n' |
| 171 | '$installInstructions'; |
KyleWong | 85ded44 | 2019-01-03 11:57:03 +0800 | [diff] [blame] | 172 | String cocoaPodsUnknownVersion(String consequence, String upgradeInstructions) => |
| 173 | 'Unknown CocoaPods version installed.\n' |
| 174 | '$consequence\n' |
| 175 | 'To upgrade:\n' |
| 176 | '$upgradeInstructions'; |
Jenn Magder | 1222926 | 2019-09-10 13:26:32 -0700 | [diff] [blame] | 177 | String cocoaPodsOutdated(String currentVersion, String recVersion, String consequence, String upgradeInstructions) => |
| 178 | 'CocoaPods $currentVersion out of date ($recVersion is recommended).\n' |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 179 | '$consequence\n' |
| 180 | 'To upgrade:\n' |
| 181 | '$upgradeInstructions'; |
Christopher Fujino | d1e0273 | 2019-08-23 09:21:09 -0700 | [diff] [blame] | 182 | String cocoaPodsBrokenInstall(String consequence, String reinstallInstructions) => |
| 183 | 'CocoaPods installed but not working.\n' |
| 184 | '$consequence\n' |
| 185 | 'To re-install CocoaPods, run:\n' |
| 186 | '$reinstallInstructions'; |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 187 | |
| 188 | // Messages used in VsCodeValidator |
| 189 | String vsCodeVersion(String version) => 'version $version'; |
| 190 | String vsCodeLocation(String location) => 'VS Code at $location'; |
| 191 | String vsCodeFlutterExtensionMissing(String url) => 'Flutter extension not installed; install from\n$url'; |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 192 | |
stuartmorgan | fb8df82 | 2019-06-06 14:02:27 -0700 | [diff] [blame] | 193 | // Messages used in VisualStudioValidator |
| 194 | String visualStudioVersion(String name, String version) => '$name version $version'; |
| 195 | String visualStudioLocation(String location) => 'Visual Studio at $location'; |
stuartmorgan | 94b7ff2 | 2020-06-04 18:53:00 -0700 | [diff] [blame] | 196 | String windows10SdkVersion(String version) => 'Windows 10 SDK version $version'; |
stuartmorgan | fb8df82 | 2019-06-06 14:02:27 -0700 | [diff] [blame] | 197 | String visualStudioMissingComponents(String workload, List<String> components) => |
| 198 | 'Visual Studio is missing necessary components. Please re-run the ' |
| 199 | 'Visual Studio installer for the "$workload" workload, and include these components:\n' |
stuartmorgan | 94b7ff2 | 2020-06-04 18:53:00 -0700 | [diff] [blame] | 200 | ' ${components.join('\n ')}\n' |
| 201 | ' Windows 10 SDK'; |
| 202 | String get windows10SdkNotFound => |
| 203 | 'Unable to locate a Windows 10 SDK. If building fails, install the Windows 10 SDK in Visual Studio.'; |
| 204 | String visualStudioMissing(String workload) => |
stuartmorgan | fb8df82 | 2019-06-06 14:02:27 -0700 | [diff] [blame] | 205 | 'Visual Studio not installed; this is necessary for Windows development.\n' |
Francisco Magdaleno | 09bb07f | 2019-09-12 18:44:36 -0700 | [diff] [blame] | 206 | 'Download at https://visualstudio.microsoft.com/downloads/.\n' |
stuartmorgan | 94b7ff2 | 2020-06-04 18:53:00 -0700 | [diff] [blame] | 207 | 'Please install the "$workload" workload, including all of its default components'; |
| 208 | String visualStudioTooOld(String minimumVersion, String workload) => |
stuartmorgan | 1be332e | 2020-01-15 08:43:03 -0800 | [diff] [blame] | 209 | 'Visual Studio $minimumVersion or later is required.\n' |
| 210 | 'Download at https://visualstudio.microsoft.com/downloads/.\n' |
stuartmorgan | 94b7ff2 | 2020-06-04 18:53:00 -0700 | [diff] [blame] | 211 | 'Please install the "$workload" workload, including all of its default components'; |
Francisco Magdaleno | 362cde4 | 2019-09-10 17:01:53 -0700 | [diff] [blame] | 212 | String get visualStudioIsPrerelease => 'The current Visual Studio installation is a pre-release version. It may not be ' |
| 213 | 'supported by Flutter yet.'; |
| 214 | String get visualStudioNotLaunchable => |
| 215 | 'The current Visual Studio installation is not launchable. Please reinstall Visual Studio.'; |
| 216 | String get visualStudioIsIncomplete => 'The current Visual Studio installation is incomplete. Please reinstall Visual Studio.'; |
| 217 | String get visualStudioRebootRequired => 'Visual Studio requires a reboot of your system to complete installation.'; |
stuartmorgan | fb8df82 | 2019-06-06 14:02:27 -0700 | [diff] [blame] | 218 | |
stuartmorgan | 8abf0a6 | 2020-05-16 15:07:34 -0700 | [diff] [blame] | 219 | // Messages used in LinuxDoctorValidator |
| 220 | String get clangMissing => 'clang++ is required for Linux development.\n' |
| 221 | 'It is likely available from your distribution (e.g.: apt install clang), or ' |
| 222 | 'can be downloaded from https://releases.llvm.org/'; |
| 223 | String clangTooOld(String minimumVersion) => 'clang++ $minimumVersion or later is required.'; |
| 224 | String get cmakeMissing => 'CMake is required for Linux development.\n' |
| 225 | 'It is likely available from your distribution (e.g.: apt install cmake), or ' |
| 226 | 'can be downloaded from https://cmake.org/download/'; |
| 227 | String cmakeTooOld(String minimumVersion) => 'cmake $minimumVersion or later is required.'; |
| 228 | String ninjaVersion(String version) => 'ninja version $version'; |
| 229 | String get ninjaMissing => 'ninja is required for Linux development.\n' |
| 230 | 'It is likely available from your distribution (e.g.: apt install ninja-build), or ' |
| 231 | 'can be downloaded from https://github.com/ninja-build/ninja/releases'; |
| 232 | String ninjaTooOld(String minimumVersion) => 'ninja $minimumVersion or later is required.'; |
stuartmorgan | 61c198e | 2020-06-16 13:31:24 -0700 | [diff] [blame] | 233 | String pkgConfigVersion(String version) => 'pkg-config version $version'; |
| 234 | String get pkgConfigMissing => 'pgk-config is required for Linux development.\n' |
| 235 | 'It is likely available from your distribution (e.g.: apt install pkg-config), or ' |
| 236 | 'can be downloaded from https://www.freedesktop.org/wiki/Software/pkg-config/'; |
| 237 | String pkgConfigTooOld(String minimumVersion) => 'pkg-config $minimumVersion or later is required.'; |
| 238 | String get gtkLibrariesMissing => 'GTK 3.0 development libraries are required for Linux development.\n' |
| 239 | 'They are likely available from your distribution (e.g.: apt install libgtk-3-dev)'; |
stuartmorgan | 8abf0a6 | 2020-05-16 15:07:34 -0700 | [diff] [blame] | 240 | |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 241 | // Messages used in FlutterCommand |
| 242 | String flutterElapsedTime(String name, String elapsedTime) => '"flutter $name" took $elapsedTime.'; |
| 243 | String get flutterNoDevelopmentDevice => |
| 244 | "Unable to locate a development device; please run 'flutter doctor' " |
| 245 | 'for information about installing additional components.'; |
| 246 | String flutterNoMatchingDevice(String deviceId) => 'No devices found with name or id ' |
| 247 | "matching '$deviceId'"; |
| 248 | String get flutterNoDevicesFound => 'No devices found'; |
| 249 | String get flutterNoSupportedDevices => 'No supported devices connected.'; |
JustWe | 6c8d7b0 | 2020-06-04 07:14:38 +0800 | [diff] [blame] | 250 | String flutterMissPlatformProjects(List<String> unsupportedDevicesType) => |
| 251 | 'If you would like your app to run on ${unsupportedDevicesType.join(' or ')}, consider running `flutter create .` to generate projects for these platforms.'; |
| 252 | String get flutterFoundButUnsupportedDevices => 'The following devices were found, but are not supported by this project:'; |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 253 | String flutterFoundSpecifiedDevices(int count, String deviceId) => |
| 254 | 'Found $count devices with name or id matching $deviceId:'; |
Natan Portilho | f567a0c | 2020-07-08 13:41:02 -0300 | [diff] [blame] | 255 | String get flutterMultipleDevicesFound => 'Multiple devices found:'; |
| 256 | String flutterChooseDevice(int option, String name, String deviceId) => '[$option]: $name ($deviceId)'; |
| 257 | String get flutterChooseOne => 'Please choose one:'; |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 258 | String get flutterSpecifyDeviceWithAllOption => |
| 259 | 'More than one device connected; please specify a device with ' |
| 260 | "the '-d <deviceId>' flag, or use '-d all' to act on all devices."; |
| 261 | String get flutterSpecifyDevice => |
| 262 | 'More than one device connected; please specify a device with ' |
| 263 | "the '-d <deviceId>' flag."; |
| 264 | String get flutterNoConnectedDevices => 'No connected devices.'; |
| 265 | String get flutterNoPubspec => |
| 266 | 'Error: No pubspec.yaml file found.\n' |
| 267 | 'This command should be run from the root of your Flutter project.\n' |
| 268 | 'Do not run this command from the root of your git clone of Flutter.'; |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 269 | String flutterTargetFileMissing(String path) => 'Target file "$path" not found.'; |
| 270 | String get flutterBasePatchFlagsExclusive => 'Error: Only one of --baseline, --patch is allowed.'; |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 271 | String get flutterBaselineRequiresTraceFile => 'Error: --baseline requires --compilation-trace-file to be specified.'; |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 272 | String get flutterPatchRequiresTraceFile => 'Error: --patch requires --compilation-trace-file to be specified.'; |
| 273 | |
| 274 | // Messages used in FlutterCommandRunner |
| 275 | String runnerNoRoot(String error) => 'Unable to locate flutter root: $error'; |
| 276 | String runnerWrapColumnInvalid(dynamic value) => |
| 277 | 'Argument to --wrap-column must be a positive integer. You supplied $value.'; |
| 278 | String runnerWrapColumnParseError(dynamic value) => |
| 279 | 'Unable to parse argument --wrap-column=$value. Must be a positive integer.'; |
| 280 | String runnerBugReportFinished(String zipFileName) => |
| 281 | 'Bug report written to $zipFileName.\n' |
| 282 | 'Warning: this bug report contains local paths, device identifiers, and log snippets.'; |
| 283 | String get runnerNoRecordTo => 'record-to location not specified'; |
| 284 | String get runnerNoReplayFrom => 'replay-from location not specified'; |
KyleWong | f9a6090 | 2019-02-16 07:56:49 +0800 | [diff] [blame] | 285 | String runnerNoEngineSrcDir(String enginePackageName, String engineEnvVar) => |
| 286 | 'Unable to detect local Flutter engine src directory.\n' |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 287 | 'Either specify a dependency_override for the $enginePackageName package in your pubspec.yaml and ' |
| 288 | 'ensure --package-root is set if necessary, or set the \$$engineEnvVar environment variable, or ' |
| 289 | 'use --local-engine-src-path to specify the path to the root of your flutter/engine repository.'; |
| 290 | String runnerNoEngineBuildDirInPath(String engineSourcePath) => |
| 291 | 'Unable to detect a Flutter engine build directory in $engineSourcePath.\n' |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 292 | "Please ensure that $engineSourcePath is a Flutter engine 'src' directory and that " |
| 293 | "you have compiled the engine in that directory, which should produce an 'out' directory"; |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 294 | String get runnerLocalEngineRequired => |
| 295 | 'You must specify --local-engine if you are using a locally built engine.'; |
| 296 | String runnerNoEngineBuild(String engineBuildPath) => |
| 297 | 'No Flutter engine build found at $engineBuildPath.'; |
| 298 | String runnerWrongFlutterInstance(String flutterRoot, String currentDir) => |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 299 | "Warning: the 'flutter' tool you are currently running is not the one from the current directory:\n" |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 300 | ' running Flutter : $flutterRoot\n' |
| 301 | ' current directory: $currentDir\n' |
| 302 | 'This can happen when you have multiple copies of flutter installed. Please check your system path to verify ' |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 303 | "that you're running the expected version (run 'flutter --version' to see which flutter is on your path).\n"; |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 304 | String runnerRemovedFlutterRepo(String flutterRoot, String flutterPath) => |
| 305 | 'Warning! This package referenced a Flutter repository via the .packages file that is ' |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 306 | "no longer available. The repository from which the 'flutter' tool is currently " |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 307 | 'executing will be used instead.\n' |
| 308 | ' running Flutter tool: $flutterRoot\n' |
| 309 | ' previous reference : $flutterPath\n' |
| 310 | 'This can happen if you deleted or moved your copy of the Flutter repository, or ' |
| 311 | 'if it was on a volume that is no longer mounted or has been mounted at a ' |
| 312 | 'different location. Please check your system path to verify that you are running ' |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 313 | "the expected version (run 'flutter --version' to see which flutter is on your path).\n"; |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 314 | String runnerChangedFlutterRepo(String flutterRoot, String flutterPath) => |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 315 | "Warning! The 'flutter' tool you are currently running is from a different Flutter " |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 316 | 'repository than the one last used by this package. The repository from which the ' |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 317 | "'flutter' tool is currently executing will be used instead.\n" |
tonyzhao1 | 3f3a829 | 2019-01-15 10:06:44 -0800 | [diff] [blame] | 318 | ' running Flutter tool: $flutterRoot\n' |
| 319 | ' previous reference : $flutterPath\n' |
| 320 | 'This can happen when you have multiple copies of flutter installed. Please check ' |
| 321 | 'your system path to verify that you are running the expected version (run ' |
Alexandre Ardhuin | f15c887 | 2020-02-11 20:58:27 +0100 | [diff] [blame] | 322 | "'flutter --version' to see which flutter is on your path).\n"; |
KyleWong | 1c0a06f | 2019-02-12 08:29:38 +0800 | [diff] [blame] | 323 | String invalidVersionSettingHintMessage(String invalidVersion) => |
| 324 | 'Invalid version $invalidVersion found, default value will be used.\n' |
| 325 | 'In pubspec.yaml, a valid version should look like: build-name+build-number.\n' |
| 326 | 'In Android, build-name is used as versionName while build-number used as versionCode.\n' |
| 327 | 'Read more about Android versioning at https://developer.android.com/studio/publish/versioning\n' |
| 328 | 'In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.\n' |
| 329 | 'Read more about iOS versioning at\n' |
| 330 | 'https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html\n'; |
Dmitry Borodin | 5a3e7e4 | 2020-03-26 23:34:00 +0200 | [diff] [blame] | 331 | |
| 332 | String _androidSdkInstallUrl(Platform platform) { |
| 333 | const String baseUrl = 'https://flutter.dev/docs/get-started/install'; |
| 334 | const String fragment = '#android-setup'; |
| 335 | if (platform.isMacOS) { |
| 336 | return '$baseUrl/macos$fragment'; |
| 337 | } else if (platform.isLinux) { |
| 338 | return '$baseUrl/linux$fragment'; |
| 339 | } else if (platform.isWindows) { |
| 340 | return '$baseUrl/windows$fragment'; |
| 341 | } else { |
| 342 | return baseUrl; |
| 343 | } |
| 344 | } |
tonyzhao1 | f8ab726 | 2018-12-19 10:10:08 -0800 | [diff] [blame] | 345 | } |