Skip to content

[flutter_tools] PathNotFoundException in BuildIOSArchiveCommand.runCommand #138030

@christopherfujino

Description

@christopherfujino

on beta/3.16.0-0.4.pre

PathNotFoundException: Cannot delete file, path = '/var/folders/m9/jk0451hd4ddfsz9nk1hx6ng80000gn/T/flutter_tools.pCAoye/flutter_build_ios.Oa3zhH/ExportOptions.plist' (OS Error: No such file or directory, errno = 2)
at _File.throwIfError(file_impl.dart:675)
at _File._deleteSync(file_impl.dart:329)
at FileSystemEntity.deleteSync(file_system_entity.dart:414)
at ForwardingFileSystemEntity.deleteSync(forwarding_file_system_entity.dart:70)
at BuildIOSArchiveCommand.runCommand(build_ios.dart:490)
at <asynchronous gap>(async)
at FlutterCommand.run.<anonymous closure>(flutter_command.dart:1350)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at CommandRunner.runCommand(command_runner.dart:212)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand.<anonymous closure>(flutter_command_runner.dart:348)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand(flutter_command_runner.dart:294)
at <asynchronous gap>(async)
at run.<anonymous closure>.<anonymous closure>(runner.dart:112)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at main(executable.dart:90)
at <asynchronous gap>(async)

The source in question is: https://github.com/flutter/flutter/blob/beta/packages/flutter_tools/lib/src/commands/build_ios.dart#L490

The issue is that although we handle the case where generatedExportPlist == null, we don't handle the case where the variable holds a valid File object, but the file does not exist on disk. The safest thing to do here would be to wrap the delete call in another try catch, and explicitly ignore FileSystemException.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions