fermoya / cocoapods-catalyst-support

Ruby extensions to help you configure your pods project so that pods not compiled for Catalyst can still be used for iOS devices
MIT License
111 stars 18 forks source link

[BUG] CocoaPods 1.10.0 and Pod distributing XCFramework is breaking the Mac Catalyst build #9

Closed rowanmulder closed 3 years ago

rowanmulder commented 3 years ago

Recently Google updated their Google Mobile Ads SDK (as well as the Google User Messaging SDK in the previous release), to move from a .framework to a .xcframework.

Unfortunately while including the libraries in the pod.file as defined in the README for the script, the build (exclusion) for Mac Catalyst fails.

--

pod.file:
pod 'Google-Mobile-Ads-SDK', '~> 7.68.0' (or without version, note requires Firebase 7 if that's also in use)
def catalyst_unsupported_pods
  [
    "Google-Mobile-Ads-SDK", ...
  ]
end

--

Build errors ld: warning: directory not found for option '-F/Users/.../Library/Developer/Xcode/DerivedData/something.com-blqqpxgyaaldrudoafizlmebhztt/Build/Products/Debug (test server)-maccatalyst/XCFrameworkIntermediates/GoogleMobileAds'

ld: warning: directory not found for option '-F/Users/.../Library/Developer/Xcode/DerivedData/something.com-blqqpxgyaaldrudoafizlmebhztt/Build/Products/Debug (test server)-maccatalyst/XCFrameworkIntermediates/UserMessagingPlatform' ld: framework not found GoogleMobileAds

Script errors warning: [CP] Unable to find matching .xcframework slice in '/Users/.../Development/ios-app/Pods/GoogleUserMessagingPlatform/Frameworks/Release/UserMessagingPlatform.xcframework UserMessagingPlatform framework ios-armv7_arm64_arm64e ios-i386_x86_64-simulator' for the current build architectures (x86_64).

warning: [CP] Unable to find matching .xcframework slice in '/Users/rmulder/Development/ios-app/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.xcframework GoogleMobileAds framework ios-armv7_arm64 ios-i386_x86_64-simulator' for the current build architectures (x86_64).

fermoya commented 3 years ago

Hey hi @rowanmulder , thanks for raising this, I'll give it a look shortly

fermoya commented 3 years ago

@rowanmulder are you using the last version of the script? I have this Podfile:

target 'CollectionViewLayoutExample' do
  use_frameworks!

  pod "Google-Mobile-Ads-SDK"
end

def catalyst_unsupported_pods
  [
    "Google-Mobile-Ads-SDK"
  ]
end

with the Manifest.lock:

PODS:
  - Google-Mobile-Ads-SDK (7.68.0):
...

And it seems to work, Build and Archive.

Could you please double check with the most updated remove_ios_only_frameworks.rb and if it still fails, could you copy paste your Podfile?

rowanmulder commented 3 years ago

Once I changed it to 7.64.0, it will fail on Google User Messaging Platform (a dependency from Google Mobile Ads), and if I change it to 7.68.0 both Google Mobile Ads and User Messaging Platform give the same errors.

I'm using CocoaPods 1.10 by the way, could that be related, I believe it also had some changes related to .xcframeworks integration?

(double checked the ruby, to be the latest from the repo)

fermoya commented 3 years ago

@rowanmulder I just checked with cocoapods 1.10.0 and that might seem to be the issue. With 1.9.0 it seems to work.

I'll give it a look, thanks

fermoya commented 3 years ago

@rowanmulder I think I got it, will you give it a look please? Use the last version, I just committed

rowanmulder commented 3 years ago

Updated the script, and I am able to build the latest releases of CocoaPods (1.10), Google Mobile Ads (7.68.0) and Firebase (7.0). Excellent, thanks!

fermoya commented 3 years ago

Cheers! It was a simple change anyways.

Thanks a million for noticing and opening this issue, it was very helpful