添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
string zipFilename = "coregsbundle.zip"; string ZipPath = Path.Combine(Android.App.Application.Context.GetExternalFilesDir(Android.OS.Environment.DirectoryDownloads).ToString(), zipFilename); ZipFile.ExtractToDirectory(ZipPath, FileSystem.AppDataDirectory); catch (Exception e) Console.WriteLine(e.Message.ToString());

From native android document: Storage updates in Android 11

Starting in Android 11, apps that use the scoped storage model can access only their own app-specific cache files

So, you cannot access the public external download folder.

You can download your file to the app internal storage, such as FileSystem.AppDataDirectory , then you can use ZipFile.ExtractToDirectory to extract a zip file on MAUI like following code.

       string zipFilename = "coregsbundle.zip";
        string ZipPath = Path.Combine(FileSystem.AppDataDirectory, zipFilename);        ZipFile.ExtractToDirectory(ZipPath, FileSystem.AppDataDirectory);

Best Regards,

Leon Lu

If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.