trinhngocthuyen / cocoapods-spm

A CocoaPods plugin to add SPM dependencies to CocoaPods-based projects
MIT License
53 stars 10 forks source link

[Bug] No module found 'Firebase' #99

Closed kalub92 closed 5 months ago

kalub92 commented 5 months ago

What happened?

I attempted to add Firebase to my project, but get a No module found 'Firebase' error when attempting to compile my app target.

image

I've reproduced this here on my fork (branch: cstultz/firebase-issue): https://github.com/kalub92/cocoapods-spm/commit/b64c0b9394127dcc52af40097f3a43c85bfb6888

CocoaPods environment

Stack

   CocoaPods : 1.14.3
        Ruby : ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin21]
    RubyGems : 3.3.3
        Host : macOS 14.5 (23F79)
       Xcode : 15.4 (15F31d)
         Git : git version 2.44.0
Ruby lib dir : /Users/cstultz/.rvm/rubies/ruby-3.1.0/lib

               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/cstultz/.rvm/gems/ruby-3.1.0/bin/pod

Plugins

cocoapods-compact-spec : 0.0.3
cocoapods-deintegrate  : 1.0.5
cocoapods-plugins      : 1.0.0
cocoapods-search       : 1.0.1
cocoapods-spm          : 0.1.5
cocoapods-trunk        : 1.6.0
cocoapods-try          : 1.2.0

Podfile

platform :ios, "16.0"
linkage = (ENV["LINKAGE"] || :static).to_sym
use_frameworks! :linkage => linkage
puts "Using linkage: #{linkage}"

@checksum = "dummy-checksum-to-prevent-merge-conflicts"

plugin "cocoapods-spm"

config_compact_spec(
  extra: ->(s) { s.ios.deployment_target = "16.0" }
)

config_cocoapods_spm(
  dont_prebuild_macros: true,
  default_macro_config: "debug"
)

target "EX" do
  pod "Logger", :path => "LocalPods/Logger"
  pod "CommonUI", :path => "LocalPods/CommonUI"
  pod "Services", :path => "LocalPods/Services"
  pod "Orcam", :macro => {
    :git => "https://github.com/trinhngocthuyen/orcam.git",
    :branch => "main"
  }
  pod "MacroCodableKit", :macro => {
    :git => "https://github.com/mikhailmaslo/macro-codable-kit",
    :tag => "0.3.0"
  }

  spm_pkg "Firebase",
          :url => "https://github.com/firebase/firebase-ios-sdk.git",
          :version => "8.14.0",
          :products => [
            "FirebaseAnalytics",
            "FirebaseCrashlytics"
          ]

  spm_pkg "SnapKit",
          :url => "https://github.com/SnapKit/SnapKit.git",
          :version => "5.7.1",
          :products => ["SnapKit-Dynamic"]
  spm_pkg "SwiftUIX", :git => "https://github.com/SwiftUIX/SwiftUIX.git", :tag => "0.1.9"
  spm_pkg "SwiftyBeaver", :git => "https://github.com/SwiftyBeaver/SwiftyBeaver.git", :tag => "2.0.0"
  spm_pkg "opentelemetry-swift",
          :git => "https://github.com/open-telemetry/opentelemetry-swift.git",
          :branch => "main",
          :products => ["OpenTelemetrySdk"]
  spm_pkg "GoogleMaps",
          :git => "https://github.com/googlemaps/ios-maps-sdk.git",
          :version => "8.4.0",
          :products => ["GoogleMaps", "GoogleMapsBase", "GoogleMapsCore"]
  spm_pkg "DebugKit", :path => "LocalPackages/debug-kit"
end

target "EXTests" do

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings.delete "IPHONEOS_DEPLOYMENT_TARGET"
    end
  end
end

Anything else?

No response

kalub92 commented 5 months ago

~Closing this issue – I needed to include BrazeKit and BrazeUI as products of braze-swift-sdk per their integration docs.~

See below.

kalub92 commented 5 months ago

Reopening this issue as I resolved my original problem with Braze, but realized that there is a separate issue with Firebase

trinhngocthuyen commented 5 months ago

Should be fixed by #99.

Just minor thing to note. After the fix, although the build succeeds, Xcode might still shows the "no such module" error. For this, I dont know why :(

Screenshot 2024-06-15 at 6 05 08 PM