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: the Link metadata on automatically included items is incorrect #7692

Closed
rolfbjarne opened this issue Jun 2, 2022 · 1 comment · Fixed by #23269
Closed

iOS: the Link metadata on automatically included items is incorrect #7692

rolfbjarne opened this issue Jun 2, 2022 · 1 comment · Fixed by #23269
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/iOS 🍎 s/triaged Issue has been reviewed t/bug Something isn't working t/housekeeping ♻︎
Milestone

Comments

@rolfbjarne
Copy link
Member

Description

The default item inclusion adds a Link metadata on the included items:

Link="%(RecursiveDir)%(FileName)%(Extension)"

Link="%(RecursiveDir)%(FileName)%(Extension)"

Link="%(RecursiveDir)%(FileName)%(Extension)"

The Link metadata specifies the path inside the app bundle for these items, with one caveat: if the value starts with IPhoneResourcePrefix:

<IPhoneResourcePrefix>$(iOSProjectFolder)Resources</IPhoneResourcePrefix>

then we strip that off the final location.

Example:

  • IPhoneResourcePrefix=Resources
  • There's a BundleResource resource with Link metadata Resources/myResource.txt
  • The final location in the app bundle would be MyApp.app/myResource.txt, because we removed IPhoneResourcePrefix from the start of the path.

In MAUI's case, this is what happens:

  • IPhoneResourcePrefix=Platform/iOS/Resources
  • There's a SceneTest.scn file in Platform/iOS/Resources/art.scnasset/SceneTest.scn
  • This file is automatically included using the glob $(iOSProjectFolder)**/*.scnassets/*, and the Link metadata is %(RecursiveDir)%(FileName)%(Extension) which resolves to Resources/art.scnasset/SceneTest.scn.
  • Notice how the Link metadata does not start with IPhoneResourcePrefix, which means the final location in the app bundle is MyApp.app/Resources/art.scnasset/SceneTest.scn, which is incorrect.

<SceneKitAsset
Include="$(iOSProjectFolder)**/*.scnassets/*"
Exclude="$(_SingleProjectiOSExcludes)"
Link="%(RecursiveDir)%(FileName)%(Extension)"
IsDefaultItem="true"
/>

Steps to Reproduce

Test project is available here: xamarin/xamarin-macios#15104

Version with bug

6.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.4

Did you find any workaround?

Yes: xamarin/xamarin-macios#15104 (comment)

Relevant log output

No response

@rolfbjarne rolfbjarne added t/bug Something isn't working s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jun 2, 2022
@Eilon Eilon added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Jun 2, 2022
@jfversluis jfversluis added platform/iOS 🍎 and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jun 10, 2022
@Zhanglirong-Winnie Zhanglirong-Winnie added the s/triaged Issue has been reviewed label Nov 30, 2023
@mattleibow mattleibow added this to the Backlog milestone Nov 30, 2023
@ghost
Copy link

ghost commented Nov 30, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/iOS 🍎 s/triaged Issue has been reviewed t/bug Something isn't working t/housekeeping ♻︎
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants