Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Cannot create archive due to the "Unzip" task failing with System.NotSupportedException because the app package content includes the link to local drive #22359

Open
Emtiaz-Tafsir opened this issue May 13, 2024 · 6 comments
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/iOS 🍎 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@Emtiaz-Tafsir
Copy link

Emtiaz-Tafsir commented May 13, 2024

Description

This is essentially a duplicate of #19916
Opening a separate issue since the issue is closed and the cause is different in my case (removing LaunchScreen.storyboard did not help)

Bug Description: The "Unzip" task fails during archive if there is a Resources folder with any images [may happen with other files too] within Platforms\iOS

If the above condition is met, the absolute path of the Platforms\iOS\Resources directory gets recreated inside the generated .app

Screenshot 2024-05-13 at 14 33 55

Because of this, the "Unzip" task fails and archiving remains incomplete.

Note that the path reference still gets created for normal Build/Rebuild operation as well, but it completes successfully and the ipa is also generated if BuildIpa is set to true. The problem appears only during the Publish operation.

The problem seems to occur just with the existence of such files even if the files are not referenced from .csproj.
Also it seems to not occur if the folder name is anything other than Resources.

Although the migration documentation states,

Resource files should typically be placed in the Resources folder of your .NET MAUI app project, or child folders of the Resources folder, and must have their build action set correctly.

The consequences of not doing is not mentioned.

Since I am porting a Xamarin app to MAUI, I wanted keep the project structure as unchanged as possible (The Xamarin app included a separate Resources folder for images referenced from platform specific code)

I have created a repro as well. Make sure to change the CodesignKey and CodesignProvision if you decide to use it.

Steps to Reproduce

  1. Create a Resources folder within Platform\iOS
  2. Place an image inside the folder
  3. Build/Rebuild should pass
  4. Publish should fail with System.NotSupportedException

Link to public reproduction project repository

https://github.com/Emtiaz-Tafsir/MauiRepro/tree/main/MauiArchiveFailureRepro

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

All

Did you find any workaround?

Restructure the project to include all the resources in the root Resources folder. Or refactor the folder name to something else

Relevant log output

No response

@Emtiaz-Tafsir Emtiaz-Tafsir added the t/bug Something isn't working label May 13, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@kevinxufei kevinxufei added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed platform/iOS 🍎 migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert labels May 13, 2024
@kevinxufei
Copy link
Collaborator

Verified this issue with Visual Studio 17.10 Preview 7.0 (8.0.21/8.0.3). Can repro it, and Xamarin. Forms project works fine.

@PureWeen
Copy link
Member

Duplicate of #19916

@PureWeen PureWeen marked this as a duplicate of #19916 May 13, 2024
@PureWeen
Copy link
Member

@PureWeen PureWeen added the s/needs-info Issue needs more info from the author label May 13, 2024
@Eilon Eilon added the area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) label May 13, 2024
@Emtiaz-Tafsir
Copy link
Author

Emtiaz-Tafsir commented May 14, 2024

@Emtiaz-Tafsir can you attach a binlog?

@PureWeen I've generated a binlog. I'll attach the redacted version below.
22359_redacted.zip

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels May 14, 2024
@rolfbjarne
Copy link
Member

I believe this is a variation of #16734; the IPhoneResourcePrefix property is set too late by MAUI.

Try adding this to your csproj:

<PropertyGroup>
    <IPhoneResourcePrefix>Platforms\iOS\Resources</IPhoneResourcePrefix>
</PropertyGroup>

and see if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/iOS 🍎 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants