blob: 6e828b342ec888551f2bdb5489721d49be268a0a [file] [log] [blame]
Ian Hickson449f4a62019-11-27 15:04:02 -08001// Copyright 2014 The Flutter Authors. All rights reserved.
liyuqiandd5559a2019-02-26 17:38:21 -08002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
tonyzhao1f8ab7262018-12-19 10:10:08 -08005import 'context.dart';
Zachary Anderson6f0ed5e2020-05-06 08:15:39 -07006import 'platform.dart';
tonyzhao1f8ab7262018-12-19 10:10:08 -08007
Jonah Williams0acd3e62019-04-25 15:51:08 -07008UserMessages get userMessages => context.get<UserMessages>();
tonyzhao1f8ab7262018-12-19 10:10:08 -08009
10/// Class containing message strings that can be produced by Flutter tools.
11class UserMessages {
James D. Linb7fd24a2020-04-28 10:34:03 -070012 // Messages used in multiple components.
13 String get flutterToolBugInstructions =>
14 'Please report a bug at https://github.com/flutter/flutter/issues.';
15
tonyzhao1f8ab7262018-12-19 10:10:08 -080016 // Messages used in FlutterValidator
17 String flutterStatusInfo(String channel, String version, String os, String locale) =>
Jenn Magderd40699a2020-04-27 15:48:22 -070018 'Channel ${channel ?? 'unknown'}, ${version ?? 'Unknown'}, on $os, locale $locale';
tonyzhao1f8ab7262018-12-19 10:10:08 -080019 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 Magder4ecb1bb2020-05-11 11:57:02 -070025 String pubMirrorURL(String url) => 'Pub download mirror $url';
26 String flutterMirrorURL(String url) => 'Flutter download mirror $url';
tonyzhao1f8ab7262018-12-19 10:10:08 -080027 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 Lawe8d968e2019-04-05 07:55:29 -070033 'On Arch: pacman -S lib32-gcc-libs';
tonyzhao1f8ab7262018-12-19 10:10:08 -080034
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 Sneath52918972019-04-05 11:39:30 -070043 'https://flutter.dev/intellij-setup/#installing-the-plugins';
tonyzhao1f8ab7262018-12-19 10:10:08 -080044 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 Sarmpanisc5b3b3a2019-10-30 19:40:27 +020059 String androidJavaMinimumVersion(String javaVersion) => 'Java version $javaVersion is older than the minimum recommended version of 1.8';
Dan Field15f21192019-02-23 09:56:57 -080060 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.';
tonyzhao1f8ab7262018-12-19 10:10:08 -080069 String androidBadSdkDir(String envKey, String homeDir) =>
70 '$envKey = $homeDir\n'
71 'but Android SDK not found at this location.';
Dmitry Borodin5a3e7e42020-03-26 23:34:00 +020072 String androidMissingSdkInstructions(String envKey, Platform platform) =>
tonyzhao1f8ab7262018-12-19 10:10:08 -080073 '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 Borodin5a3e7e42020-03-26 23:34:00 +020076 '(or visit ${_androidSdkInstallUrl(platform)} for detailed instructions).\n'
Dan Field15f21192019-02-23 09:56:57 -080077 'If the Android SDK has been installed to a custom location, set $envKey to that location.\n'
tonyzhao1f8ab7262018-12-19 10:10:08 -080078 '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 Borodin5a3e7e42020-03-26 23:34:00 +020082 String androidSdkInstallHelp(Platform platform) =>
tonyzhao1f8ab7262018-12-19 10:10:08 -080083 'Try re-installing or updating your Android SDK,\n'
Dmitry Borodin5a3e7e42020-03-26 23:34:00 +020084 'visit ${_androidSdkInstallUrl(platform)} for detailed instructions.';
tonyzhao1f8ab7262018-12-19 10:10:08 -080085 // 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 Borodin5a3e7e42020-03-26 23:34:00 +020097 String androidLicensesUnknown(Platform platform) =>
Dan Field15f21192019-02-23 09:56:57 -080098 'Android license status unknown.\n'
Otokazea821bdb2020-07-21 17:21:03 +080099 'Run `flutter doctor --android-licenses` to accept the SDK licenses.\n'
100 'See ${_androidSdkInstallUrl(platform)} for more details.';
Dan Field19b8d2e2019-01-23 15:56:48 -0800101 String androidSdkManagerOutdated(String managerPath) =>
tonyzhao1f8ab7262018-12-19 10:10:08 -0800102 '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 Borodin5a3e7e42020-03-26 23:34:00 +0200106 String androidMissingSdkManager(String sdkManagerPath, Platform platform) =>
tonyzhao1f8ab7262018-12-19 10:10:08 -0800107 'Android sdkmanager tool not found ($sdkManagerPath).\n'
108 'Try re-installing or updating your Android SDK,\n'
Dmitry Borodin5a3e7e42020-03-26 23:34:00 +0200109 'visit ${_androidSdkInstallUrl(platform)} for detailed instructions.';
110 String androidCannotRunSdkManager(String sdkManagerPath, String error, Platform platform) =>
Zachary Andersona5d23d22019-07-30 08:19:58 -0700111 'Android sdkmanager tool was found, but failed to run ($sdkManagerPath): "$error".\n'
112 'Try re-installing or updating your Android SDK,\n'
Dmitry Borodin5a3e7e42020-03-26 23:34:00 +0200113 'visit ${_androidSdkInstallUrl(platform)} for detailed instructions.';
114 String androidSdkBuildToolsOutdated(String managerPath, int sdkMinVersion, String buildToolsMinVersion, Platform platform) =>
Dan Field19b8d2e2019-01-23 15:56:48 -0800115 'Flutter requires Android SDK $sdkMinVersion and the Android BuildTools $buildToolsMinVersion\n'
116 'To update using sdkmanager, run:\n'
Christian Wenz428d1042019-03-15 16:58:33 +0100117 ' "$managerPath" "platforms;android-$sdkMinVersion" "build-tools;$buildToolsMinVersion"\n'
Dmitry Borodin5a3e7e42020-03-26 23:34:00 +0200118 'or visit ${_androidSdkInstallUrl(platform)} for detailed instructions.';
tonyzhao1f8ab7262018-12-19 10:10:08 -0800119
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 Fielddf465c72019-03-07 10:45:29 -0800127 String get aaptNotFound =>
128 'Could not locate aapt. Please ensure you have the Android buildtools installed.';
tonyzhao1f8ab7262018-12-19 10:10:08 -0800129
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 Borodin5a3e7e42020-03-26 23:34:00 +0200134 String androidStudioInstallation(Platform platform) =>
tonyzhao1f8ab7262018-12-19 10:10:08 -0800135 'Android Studio not found; download from https://developer.android.com/studio/index.html\n'
Dmitry Borodin5a3e7e42020-03-26 23:34:00 +0200136 '(or visit ${_androidSdkInstallUrl(platform)} for detailed instructions).';
tonyzhao1f8ab7262018-12-19 10:10:08 -0800137
stuartmorgan81c38b22019-05-24 22:51:02 -0400138 // Messages used in XcodeValidator
139 String xcodeLocation(String location) => 'Xcode at $location';
Jenn Magder4fba7742020-07-14 17:16:02 -0700140 String xcodeOutdated(int versionMajor, int versionMinor, int versionPatch) =>
141 'Flutter requires a minimum Xcode version of $versionMajor.$versionMinor.$versionPatch.\n'
tonyzhao1f8ab7262018-12-19 10:10:08 -0800142 'Download the latest version or update via the Mac App Store.';
Alexandre Ardhuinf15c8872020-02-11 20:58:27 +0100143 String get xcodeEula => "Xcode end user license agreement not signed; open Xcode or run the command 'sudo xcodebuild -license'.";
stuartmorgan81c38b22019-05-24 22:51:02 -0400144 String get xcodeMissingSimct =>
tonyzhao1f8ab7262018-12-19 10:10:08 -0800145 'Xcode requires additional components to be installed in order to run.\n'
Jenn Magder55530d92019-11-14 10:45:47 -0800146 'Launch Xcode and install additional required components when prompted or run:\n'
147 ' sudo xcodebuild -runFirstLaunch';
stuartmorgan81c38b22019-05-24 22:51:02 -0400148 String get xcodeMissing =>
tonyzhao1f8ab7262018-12-19 10:10:08 -0800149 'Xcode not installed; this is necessary for iOS development.\n'
150 'Download at https://developer.apple.com/xcode/download/.';
stuartmorgan81c38b22019-05-24 22:51:02 -0400151 String get xcodeIncomplete =>
tonyzhao1f8ab7262018-12-19 10:10:08 -0800152 '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 Magder55530d92019-11-14 10:45:47 -0800156 ' sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer\n'
157 ' sudo xcodebuild -runFirstLaunch';
stuartmorgan81c38b22019-05-24 22:51:02 -0400158
tonyzhao1f8ab7262018-12-19 10:10:08 -0800159 // 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 Ardhuinf15c8872020-02-11 20:58:27 +0100166 "once to finalize CocoaPods' installation.";
tonyzhao1f8ab7262018-12-19 10:10:08 -0800167 String cocoaPodsMissing(String consequence, String installInstructions) =>
168 'CocoaPods not installed.\n'
169 '$consequence\n'
170 'To install:\n'
171 '$installInstructions';
KyleWong85ded442019-01-03 11:57:03 +0800172 String cocoaPodsUnknownVersion(String consequence, String upgradeInstructions) =>
173 'Unknown CocoaPods version installed.\n'
174 '$consequence\n'
175 'To upgrade:\n'
176 '$upgradeInstructions';
Jenn Magder12229262019-09-10 13:26:32 -0700177 String cocoaPodsOutdated(String currentVersion, String recVersion, String consequence, String upgradeInstructions) =>
178 'CocoaPods $currentVersion out of date ($recVersion is recommended).\n'
tonyzhao1f8ab7262018-12-19 10:10:08 -0800179 '$consequence\n'
180 'To upgrade:\n'
181 '$upgradeInstructions';
Christopher Fujinod1e02732019-08-23 09:21:09 -0700182 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';
tonyzhao1f8ab7262018-12-19 10:10:08 -0800187
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';
tonyzhao13f3a8292019-01-15 10:06:44 -0800192
stuartmorganfb8df822019-06-06 14:02:27 -0700193 // Messages used in VisualStudioValidator
194 String visualStudioVersion(String name, String version) => '$name version $version';
195 String visualStudioLocation(String location) => 'Visual Studio at $location';
stuartmorgan94b7ff22020-06-04 18:53:00 -0700196 String windows10SdkVersion(String version) => 'Windows 10 SDK version $version';
stuartmorganfb8df822019-06-06 14:02:27 -0700197 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'
stuartmorgan94b7ff22020-06-04 18:53:00 -0700200 ' ${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) =>
stuartmorganfb8df822019-06-06 14:02:27 -0700205 'Visual Studio not installed; this is necessary for Windows development.\n'
Francisco Magdaleno09bb07f2019-09-12 18:44:36 -0700206 'Download at https://visualstudio.microsoft.com/downloads/.\n'
stuartmorgan94b7ff22020-06-04 18:53:00 -0700207 'Please install the "$workload" workload, including all of its default components';
208 String visualStudioTooOld(String minimumVersion, String workload) =>
stuartmorgan1be332e2020-01-15 08:43:03 -0800209 'Visual Studio $minimumVersion or later is required.\n'
210 'Download at https://visualstudio.microsoft.com/downloads/.\n'
stuartmorgan94b7ff22020-06-04 18:53:00 -0700211 'Please install the "$workload" workload, including all of its default components';
Francisco Magdaleno362cde42019-09-10 17:01:53 -0700212 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.';
stuartmorganfb8df822019-06-06 14:02:27 -0700218
stuartmorgan8abf0a62020-05-16 15:07:34 -0700219 // 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.';
stuartmorgan61c198e2020-06-16 13:31:24 -0700233 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)';
stuartmorgan8abf0a62020-05-16 15:07:34 -0700240
tonyzhao13f3a8292019-01-15 10:06:44 -0800241 // 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.';
JustWe6c8d7b02020-06-04 07:14:38 +0800250 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:';
tonyzhao13f3a8292019-01-15 10:06:44 -0800253 String flutterFoundSpecifiedDevices(int count, String deviceId) =>
254 'Found $count devices with name or id matching $deviceId:';
Natan Portilhof567a0c2020-07-08 13:41:02 -0300255 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:';
tonyzhao13f3a8292019-01-15 10:06:44 -0800258 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.';
tonyzhao13f3a8292019-01-15 10:06:44 -0800269 String flutterTargetFileMissing(String path) => 'Target file "$path" not found.';
270 String get flutterBasePatchFlagsExclusive => 'Error: Only one of --baseline, --patch is allowed.';
tonyzhao13f3a8292019-01-15 10:06:44 -0800271 String get flutterBaselineRequiresTraceFile => 'Error: --baseline requires --compilation-trace-file to be specified.';
tonyzhao13f3a8292019-01-15 10:06:44 -0800272 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';
KyleWongf9a60902019-02-16 07:56:49 +0800285 String runnerNoEngineSrcDir(String enginePackageName, String engineEnvVar) =>
286 'Unable to detect local Flutter engine src directory.\n'
tonyzhao13f3a8292019-01-15 10:06:44 -0800287 '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 Ardhuinf15c8872020-02-11 20:58:27 +0100292 "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";
tonyzhao13f3a8292019-01-15 10:06:44 -0800294 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 Ardhuinf15c8872020-02-11 20:58:27 +0100299 "Warning: the 'flutter' tool you are currently running is not the one from the current directory:\n"
tonyzhao13f3a8292019-01-15 10:06:44 -0800300 ' 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 Ardhuinf15c8872020-02-11 20:58:27 +0100303 "that you're running the expected version (run 'flutter --version' to see which flutter is on your path).\n";
tonyzhao13f3a8292019-01-15 10:06:44 -0800304 String runnerRemovedFlutterRepo(String flutterRoot, String flutterPath) =>
305 'Warning! This package referenced a Flutter repository via the .packages file that is '
Alexandre Ardhuinf15c8872020-02-11 20:58:27 +0100306 "no longer available. The repository from which the 'flutter' tool is currently "
tonyzhao13f3a8292019-01-15 10:06:44 -0800307 '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 Ardhuinf15c8872020-02-11 20:58:27 +0100313 "the expected version (run 'flutter --version' to see which flutter is on your path).\n";
tonyzhao13f3a8292019-01-15 10:06:44 -0800314 String runnerChangedFlutterRepo(String flutterRoot, String flutterPath) =>
Alexandre Ardhuinf15c8872020-02-11 20:58:27 +0100315 "Warning! The 'flutter' tool you are currently running is from a different Flutter "
tonyzhao13f3a8292019-01-15 10:06:44 -0800316 'repository than the one last used by this package. The repository from which the '
Alexandre Ardhuinf15c8872020-02-11 20:58:27 +0100317 "'flutter' tool is currently executing will be used instead.\n"
tonyzhao13f3a8292019-01-15 10:06:44 -0800318 ' 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 Ardhuinf15c8872020-02-11 20:58:27 +0100322 "'flutter --version' to see which flutter is on your path).\n";
KyleWong1c0a06f2019-02-12 08:29:38 +0800323 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 Borodin5a3e7e42020-03-26 23:34:00 +0200331
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 }
tonyzhao1f8ab7262018-12-19 10:10:08 -0800345}