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] Framework not found FirebaseAnalytics #19

Closed whywilson closed 3 years ago

whywilson commented 3 years ago

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

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)
fermoya commented 3 years ago

@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:

whywilson commented 3 years ago

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.

fermoya commented 3 years ago

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
whywilson commented 3 years ago

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. 😊