Open praeclarum opened 5 years ago
Hi @praeclarum,
I tried to add some random JPG/JPEG from Google as a bundle resource in a new Xamarin.iOS project, then open with preview, duplicate, resize and save but I don't think I was able to generate com.apple.FinderInfo
(not quite sure where that file would live) but in any case I couldn't reproduce the signing issue.
Could you please attach a simple test project that shows the issue?
Thanks
Hi @VincentDondain, make sure you have the culprit metadata - this bug won't repro without it.
com.apple.FinderInfo
is not a file - it's metadata stored in the file system. You can verify you have it by using xattr
.
You can add it to any file using xattr
(please read the attached SO post).
The preview instruction did not work but creating the same is easy.
xattr -wx com.apple.FinderInfo "00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" ~/Projects/bugs/gh5202/Resources/IMG_6676.JPG
Considering some metadata is fine (while others are not) it might be better to document the issue and making sure the error message links to that documentation.
The alternative would require scanning many files before signing, which is time consuming (affecting build times) for a very low probability of having to clean the metadata (and that's assuming the allowed/disallowed metadata does not change over time).
Ran into this again and had to lookup this bug to remember how to work around it. It would be nice if the error identified the file or linked to documentation.
I am also seeing this issue.
Repro:
https://github.com/CommunityToolkit/Maui.NativeLibraryInterop/tree/main/template
When I run the sample in the template folder linked above, it deploys successfully to iOS (net8.0-ios, iPhone 15 Pro Max 17.4). However, when I copy the template folder into a cloud storage location, it fails to build and shows the codesign errors. xattr -cr
did not help in my case.
It's possible to add BundleResource files to a project that contain metadata (xattrs) that later will cause a build to be unsignable with this error:
The culprit is
com.apple.FinderInfo
and is clearable using instructions here: https://stackoverflow.com/questions/39652867/code-sign-error-in-macos-high-sierra-xcode-resource-fork-finder-informationSteps to Reproduce
You need a file with
com.apple.FinderInfo
, here's one silly way to create one:Expected Behavior
It would be nice if the tooling cleared the metadata for me.
Alternatively, just giving a better error and locating the bad files is OK too.
Actual Behavior
Error
Environment