fermoya/cocoapods-catalyst-support

[BUG] Framework not found FirebaseAnalytics

Closed this issue · 4 comments

Describe the bug
I'm adding macOS support with the project built on iOS which has Firebase Analytics and messaging. And your work seems to be a good solution for the issues. But after the configuring, it always shows the framework not found.

Podfile

require 'cocoapods-catalyst-support'

# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'


target 'xxxxxxxxxxxxxxxxx' do
  use_frameworks!
  pod 'Firebase/Analytics'
  pod 'Firebase/Messaging'
  pod 'Firebase/InAppMessaging'
end

catalyst_configuration do
  verbose!

  ios 'Firebase/Analytics'
  ios 'Firebase/Messaging'
  ios 'Firebase/InAppMessaging'
end

post_install do |installer|
  installer.configure_catalyst
end

Environment

  • cocoapods-catalyst-support => cocoapods-catalyst-support (0.1.2)
  • Ruby version [e.g 2.6.0] => ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
  • Cocoapods version [e.g 1.10.0] => 1.10.1
  • Xcode version [e.g 12.2] => Xcode 12.4

Additional context

ld: warning: directory not found for option '-F/Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxxxxxxxxxx/Build/Products/Release-maccatalyst/XCFrameworkIntermediates/FirebaseAnalytics'
ld: warning: directory not found for option '-F/Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxxxxxxxxxx/Build/Products/Release-maccatalyst/XCFrameworkIntermediates/GoogleAppMeasurement'
ld: framework not found FirebaseAnalytics
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@whywilson is that your entire Podfile? I've added those dependencies to the Sample project and it compiles fine. Firebase/Analytics is a basic dependency and I've tried it many times.

Please, make sure to:

  • Run pod catalyst run in your project directory
  • Use #if !targetEnvironment(macCatalyst) where necessary
  • Try your Podfile in a smaller project, for instance Sample project. Sometimes, your project will have some kind of configuration that's not standard and will break the linker. Start by adding a handful of dependencies and build it up from there.

Thank you for the reply.
It is the entire Podfile.
Here's more information I've tried but still failed.

Podfile Now

require 'cocoapods-catalyst-support'

# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
use_frameworks!

target 'autobulbfinder' do
  pod 'Firebase/Analytics'
#  pod 'Firebase/Messaging'
#  pod 'Firebase/InAppMessaging'
end

catalyst_configuration do
  verbose!

  ios 'Firebase/Analytics'
#  ios 'Firebase/Messaging'
#  ios 'Firebase/InAppMessaging'
end

post_install do |installer|
  installer.configure_catalyst
end
  1. Comment import Firebase and relative code (No Firebase code in the project now).
  2. Run pod catalyst run
  3. Get the error below.
ld: warning: directory not found for option '-F/Users/xxxxxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxxxxxxxxxx/Build/Products/Release-maccatalyst/XCFrameworkIntermediates/FirebaseAnalytics'
ld: warning: directory not found for option '-F/Users/xxxxxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxxxxxxxxxx/Build/Products/Release-maccatalyst/XCFrameworkIntermediates/GoogleAppMeasurement'
ld: framework not found FirebaseABTesting
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Btw, I'm using MBP 2018 13" on Big Sur 11.1.

I've created a new branch task/issue-19 and committed there some changes to the Sample Project Podfile to add those dependencies. Could you please download it following this link and let me know if it compiles?

Screen Shot 2021-03-11 at 12 08 18

Thank you for providing the project to test again.
Everything works well and builds success.
After the comparison, I found it's the Other Linker Flags in Build Settings of Target results in the error.
After removing all for the macOS, it builds success without unsupported dependency.
This issue can be closed now. Thanks again. 😊