-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectfyi-toolFor the attention of Flutter Tool teamFor the attention of Flutter Tool teamplatform-androidAndroid applications specificallyAndroid applications specificallyplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
Steps to reproduce
- Create an empty project e.g. via
flutter create demo - Open the android directory in Android Studio
Expected results
The Gradle project could be opened on Windows
Actual results
You get a strange Gradle error:
Missing ExternalProject for :
Related issue: https://youtrack.jetbrains.com/issue/IDEA-329756/Importing-symlinked-Gradle-included-build-fails#focus=Comments-27-11721320.0-0
Possible Fix:
rekire@335484e
/// Escapes [path].
///
/// On Windows it replaces all '\' with '\\'. On other platforms, it returns the
/// path unchanged.
- String escapePath(String path) => _platform.isWindows ? path.replaceAll(r'\', r'\\') : path;
+ String escapePath(String path) {
+ if (_platform.isWindows) {
+ final unified = path.replaceAll(r'\', r'\\');
+ // ensure that the drive letter is upper case see
+ // https://youtrack.jetbrains.com/issue/IDEA-329756/Importing-symlinked-Gradle-included-build-fails#focus=Comments-27-11721320.0-0
+ return unified[0].toUpperCase() + unified.substring(1);
+ } else {
+ return path;
+ }
}Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectfyi-toolFor the attention of Flutter Tool teamFor the attention of Flutter Tool teamplatform-androidAndroid applications specificallyAndroid applications specificallyplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform teamTriaged by Android platform team