diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.cs index a74aca915faaf..c905b16a50902 100644 --- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.cs +++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.cs @@ -81,7 +81,14 @@ public static void ExtractToFile(this ZipArchiveEntry source, string destination ExtractExternalAttributes(fs, source); } - File.SetLastWriteTime(destinationFileName, source.LastWriteTime.DateTime); + try + { + File.SetLastWriteTime(destinationFileName, source.LastWriteTime.DateTime); + } + catch (UnauthorizedAccessException) + { + // some OSes like Android (#35374) might not support setting the last write time, the extraction should not fail because of that + } } static partial void ExtractExternalAttributes(FileStream fs, ZipArchiveEntry entry);