Puneet Mahajan
Puneet Mahajan

Reputation: 11

Exclude 'FirebaseAnalytics' pod when porting to Mac catalyst

I have tried so many solutions by running the script but didn't work out. I want to exclude 'FirebaseAnalytics' pod which is not compatible with Mac Catalyst.

When I tried to build project with script then I got the same error which I got it before.

Script which I mentioned in pod file:

post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name.start_with?("Pods")
  puts "Updating #{target.name} to exclude Firebase/Analytics"
  target.build_configurations.each do |config|
    xcconfig_path = config.base_configuration_reference.real_path
    xcconfig = File.read(xcconfig_path)
    xcconfig.sub!('-framework "FirebaseAnalytics"', '')
    new_xcconfig = xcconfig + 'OTHER_LDFLAGS[sdk=iphone*] = -framework "FirebaseAnalytics"'
    File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
  end
end
end
end

Build error:

ld: in /Users/puneemahajan/Desktop/harmony-hdm-ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics(aligned_new_ea6edd0c9156cfb37bd6a8b17f2e984f.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, file '/Users/puneemahajan/Desktop/harmony-hdm-ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics' for architecture x86_64

Upvotes: 1

Views: 271

Answers (1)

KY1VSTAR
KY1VSTAR

Reputation: 455

Check out this solution https://github.com/fermoya/CatalystPodSupport. I personally use it to remove some pods including Firebase Analytics and it's works great.

Upvotes: 2

Related Questions