hmhv / YoutubePlayer-in-WKWebView

Helper library for iOS developers looking to add YouTube video playback in their applications via the iframe player in a WKWebView
Other
221 stars 96 forks source link

Multiple commands produce PrivacyInfo.xcprivacy #35

Closed tmakic closed 3 months ago

tmakic commented 4 months ago

I am currently working on a project and have encountered an issue when trying to build with PrivacyInfo.xcprivacy added.

The error message I am receiving is as follows:

Multiple commands produce '/Users/tomoyo.makino/Library/Developer/Xcode/DerivedData/MyProject-xxx/ArchiveIntermediates/MyProject(Production)/InstallationBuildProductsLocation/Applications/MyProject.app/MyProject'

While I haven't been able to definitively identify the cause, I believe it may be related to a similar issue reported here:

Error: ’Multiple commands produce PrivacyInfo.xcprivacy’ (when using a third party library via cocoapods)

Solution: The problem seems to appear when using 3rd party cocoapods which include a PrivacyInfo.xcprivacy file.

The problem must be solved by the developer of the 3rd party lib by changing the podspec:
Change:

sp.resource = “Sources/Resources/PrivacyInfo.xcprivacy”

to

sp.resource_bundles = { “Podname” => “Sources/Resources/PrivacyInfo.xcprivacy” }

I would greatly appreciate it if you could consider making changes to the podspec.

Other references

https://github.com/CocoaPods/CocoaPods/issues/10325#issuecomment-1718723762

https://developer.apple.com/forums/thread/733537

version

0.3.9

System Information

System:
  macOS 14.4.1 / Apple M1

Managers:
  CocoaPods:
    version: 1.15.2

IDEs:
  Xcode:
    version: 15.2

Steps to Reproduce

trying to build with XCode: Product > Archive

dmitriiivashko commented 4 months ago

Fixed by #36

neuneed commented 4 months ago

Fixed by #36

@hmhv Can we merge and release this code change?

hmhv commented 4 months ago

@tmakic @dmitriiivashko @neuneed

Currently I don't use cocoapods, only SPM. so i just merged #36, but after merge, i can't update pod info with error. It worked with me before #36.

pod trunk push

[!] Found podspec `YoutubePlayer-in-WKWebView.podspec`
Updating spec repo `trunk`
Validating podspec
 -> YoutubePlayer-in-WKWebView (0.3.10)
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | [iOS] xcodebuild:  note: Building targets in dependency order
    - NOTE  | [iOS] xcodebuild:  note: Target dependency graph (4 targets)
    - NOTE  | [iOS] xcodebuild:  error: Multiple commands produce '/Users/u1/Library/Developer/Xcode/DerivedData/App-hgmdbflozkqedggzshyecrzkybai/Build/Products/Release-iphonesimulator/YoutubePlayer-in-WKWebView/YoutubePlayer_in_WKWebView.framework/WKYTPlayerView.bundle'
    - NOTE  | [iOS] xcodebuild:  note: Target 'YoutubePlayer-in-WKWebView' (project 'Pods') has copy command from '/Users/u1/Library/Developer/Xcode/DerivedData/App-hgmdbflozkqedggzshyecrzkybai/Build/Products/Release-iphonesimulator/YoutubePlayer-in-WKWebView/WKYTPlayerView.bundle' to '/Users/u1/Library/Developer/Xcode/DerivedData/App-hgmdbflozkqedggzshyecrzkybai/Build/Products/Release-iphonesimulator/YoutubePlayer-in-WKWebView/YoutubePlayer_in_WKWebView.framework/WKYTPlayerView.bundle'
    - NOTE  | [iOS] xcodebuild:  note: Target 'YoutubePlayer-in-WKWebView' (project 'Pods') has copy command from 'YoutubePlayer-in-WKWebView/WKYTPlayerView/WKYTPlayerView.bundle' to '/Users/u1/Library/Developer/Xcode/DerivedData/App-hgmdbflozkqedggzshyecrzkybai/Build/Products/Release-iphonesimulator/YoutubePlayer-in-WKWebView/YoutubePlayer_in_WKWebView.framework/WKYTPlayerView.bundle'
    - NOTE  | [iOS] xcodebuild:  warning: duplicate output file '/Users/u1/Library/Developer/Xcode/DerivedData/App-hgmdbflozkqedggzshyecrzkybai/Build/Products/Release-iphonesimulator/YoutubePlayer-in-WKWebView/YoutubePlayer_in_WKWebView.framework/WKYTPlayerView.bundle' on task: CpResource /Users/u1/Library/Developer/Xcode/DerivedData/App-hgmdbflozkqedggzshyecrzkybai/Build/Products/Release-iphonesimulator/YoutubePlayer-in-WKWebView/YoutubePlayer_in_WKWebView.framework/WKYTPlayerView.bundle YoutubePlayer-in-WKWebView/WKYTPlayerView/WKYTPlayerView.bundle (in target 'YoutubePlayer-in-WKWebView' from project 'Pods')

[!] The spec did not pass validation, due to 1 error.
pod --version
1.15.2

so i fixed some more https://github.com/hmhv/YoutubePlayer-in-WKWebView/commit/fb7c91b9e835f7a2a0edc98b143fb2938c68b6a2

can you check it work well? (0.3.11)

neuneed commented 3 months ago

@hmhv Sorry for the delay, I test with https://github.com/hmhv/YoutubePlayer-in-WKWebView/pull/36 and it works fine. also test with your recent release: https://github.com/hmhv/YoutubePlayer-in-WKWebView/commit/fb7c91b9e835f7a2a0edc98b143fb2938c68b6a2 which is 0.3.11 also works well.

My pod version is

bundle exec pod --version
1.13.0

You can try with the old version. From I know Cocoapods 1.15 introduced a bug which break the build. So that maybe you should set you version between '>= 1.13', '< 1.15'.

Thanks for the help!