Repository: flutter
Issue: [tool_crash] FileSystemException: Deletion failed, OS Error: Directory not empty, errno = 66
Labels: c: crash,tool,P2,team-tool,triaged-tool

## Command
```
flutter build ios --release
```

## Steps to Reproduce
1. ...
2. ...
3. ...

## Logs
FileSystemException: Deletion failed, OS Error: Directory not empty, errno = 66
```
#0      _Directory._deleteSync (dart:io/directory_impl.dart:201:7)
#1      FileSystemEntity.deleteSync (dart:io/file_system_entity.dart:458:47)
#2      ForwardingFileSystemEntity.deleteSync (package:file/src/forwarding/forwarding_file_system_entity.dart:72:16)
#3      _deleteIfExistsSync (package:flutter_tools/src/project.dart:906:15)
#4      IosProject._regenerateFromTemplateIfNeeded (package:flutter_tools/src/project.dart:615:5)
#5      IosProject.ensureReadyForPlatformSpecificTooling (package:flutter_tools/src/project.dart:566:11)
#6      FlutterProject.ensureReadyForPlatformSpecificTooling (package:flutter_tools/src/project.dart:246:17)
<asynchronous suspension>
#7      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:843:21)
<asynchronous suspension>
#8      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:741:33)
<asynchronous suspension>
#9      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart)
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#11     _rootRun (dart:async/zone.dart:1190:13)
#12     _CustomZone.run (dart:async/zone.dart:1093:19)
#13     _runZoned (dart:async/zone.dart:1630:10)
#14     runZoned (dart:async/zone.dart:1550:10)
#15     AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#16     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:730:20)
#17     CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#18     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:332:21)
<asynchronous suspension>
#19     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart)
#20     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
```
```
[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G2021, locale zh-Hans-CN)
    • Flutter version 1.20.2 at /Users/jessejcwang/flutter
    • Framework revision bbfbf1770c (10 天前), 2020-08-13 08:33:09 -0700
    • Engine revision 9d5b21729f
    • Dart version 2.9.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/jessejcwang/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 48.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.48.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.13.2

[✓] Connected device (1 available)
    • iPhone SE (2nd generation) (mobile) • B0A18CFA-4BAB-417D-864E-4E6E0233DAAC • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)

• No issues found!

```

## Flutter Application Metadata
**Type**: module
**Version**: 1.0.0+1
**Material**: true
**Android X**: null
**Module**: true
**Plugin**: false
**Android package**: com.example.hb_flutter
**iOS bundle identifier**: com.example.hbFlutter
**Creation channel**: master
**Creation framework version**: 40138f5456ea7b76fb3643266ac7f2bcb03597a5
### Plugins
icx_hb_content
icx_hb_login
icx_hb_solution
icx_hb_webview