RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
224 stars 27 forks source link

[iOS] Xcode validation error - signature of "AVProVideo.xcframework" cannot be validated #1876

Closed ACCIAI0 closed 2 weeks ago

ACCIAI0 commented 1 month ago

Describe the issue I was evaluating this plugin to use both on windows and iOS for a project, but while it works perfectly on windows, xcode won't even compile, saying that AVProVideo.xcframework signature can't be validated.

Your Setup (please complete the following information):

Logs The signature of "AVProVideo.xcframework" cannot be validated and may have been compromised.

Chris-RH commented 1 month ago

The signature being incorrect suggests that either the plugin failed to be copied correctly from Unity as part of the build process, or it has been tampered with and the xcframework folder is either missing files or contains extra files.

The layout of the xcframework folder should match this: AVProVideo.xcframework

_CodeSignature CodeDirectory CodeRequirements CodeRequirements-1 CodeResources CodeSignature xrOS-arm64 PrivacyInfo.xcprivacy libAVProVideo.a xrOS-arm64-simultator PrivacyInfo.xcprivacy libAVProVideo.a Info.plist There should be some logging as part of the build detailing what is being done and if there are any errors and will look similar to this:

[AVProVideo] Post-processing generated Xcode project... [AVProVideo] Opening Xcode project at: /Users/User/Path/To/Built/Xcode/Project [AVProVideo] Found plugin at 'Assets/AVProVideo/Runtime/Plugins/visionOS/AVProVideo.xcframework' [AVProVideo] Copying AVProVideo.xcframework into the Xcode project at Libraries/AVProVideo [AVProVideo] Writing AVProVideoBootstrap.m to the UnityFramework target [AVProVideo] Writing AVProVideoForceSwift.swift to the UnityFramework target [AVProVideo] Finished modifying Xcode project If there are any error messages reported in the log as part of the build process please paste them here so we can investigate further.

ACCIAI0 commented 1 month ago

It seems to me the folder structure is the one you're saying:

immagine

with the difference it's not under Libraries but under Assets/Plugins. The same is valid for the log, which looks exactly as you wrote, verbatim without any error. The fact is that Unity does successfully builds the xcode project, but then xcode won't build it.

ACCIAI0 commented 1 month ago

UPDATE: For now I've just fixed by removing the _CodeSignature folder. Xcode will give a warning for an unsigned framework but this way it will compile successfully once the warning dialog is confirmed.

MorrisRH commented 3 weeks ago

The meta files are the problem here, they should be being stripped out when Unity copies the xcframework to the Xcode project.

Unity threw us a curveball by introducing xcframework support into versions 2021.3.37f1, 2023.2.18f1 and 2023.2.18f1 so we're no longer responsible for copying over the plugin files.

I'm trying to see if I can reproduce it using Unity 2021.3.38f1.

MorrisRH commented 3 weeks ago

Also worth noting that if any .DS_Store files creep in (by opening the xcframework folder in finder) then this will also break the code signing.

MorrisRH commented 3 weeks ago

This should be fixed with the next release of the plugin (version 3.0.2).

For Unity versions older than 2021.3.37f1, 2022.3.23f1 and 2023.2.18f1 we now ensure .DS_Store files are not copied when copying over the xcframework. For more recent Unity versions we now make sure to strip out .meta and .DS_Store files from the xcframework as part of the build process.

If you open the xcframework folder in the built project in Finder a .DS_Store file will be written which will break the code signing. Unfortunately there is not much we can do about this. It would be nice if code signature check knew to avoid these files.

Chris-RH commented 3 weeks ago

AVPro Video version 3.0.2 has been released. Please let us know if it has not fixed your issue.