Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.6.0.beta.1] No such module "Firebase" in Swift Tests #8033

Closed
edenman opened this issue Aug 21, 2018 · 21 comments
Closed

[1.6.0.beta.1] No such module "Firebase" in Swift Tests #8033

edenman opened this issue Aug 21, 2018 · 21 comments
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Milestone

Comments

@edenman
Copy link

edenman commented Aug 21, 2018

Report

Upgrading CocoaPods to 1.6.0.beta.1 (from 1.5.3) breaks my Swift unit tests with a "No such module 'Firebase'" error

What did you do?

gem install cocoapods --pre

What did you expect to happen?

Nothing to change except the version# in the Podfile.lock :)

What happened instead?

old, working: "${SRCROOT}/../Pods/Target Support Files/Pods-Taco/Pods-Taco-frameworks.sh",
new, busted: "${PODS_ROOT}/Target Support Files/Pods-Taco/Pods-Taco-frameworks.sh",

(I have no idea why this matters, those paths map to the same location. maybe it's a red herring?)

CocoaPods Environment

Stack

   CocoaPods : 1.6.0.beta.1
        Ruby : ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
    RubyGems : 2.5.1
        Host : Mac OS X 10.13.6 (17G65)
       Xcode : 9.4.1 (9F2000)
         Git : git version 2.14.1
Ruby lib dir : /usr/local/Cellar/ruby/2.3.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 39056189d4920e85670b12dda1750be61ee34ea2

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate  : 1.0.2
cocoapods-dependencies : 1.1.0
cocoapods-plugins      : 1.0.0
cocoapods-search       : 1.0.0
cocoapods-stats        : 1.0.0
cocoapods-trunk        : 1.3.1
cocoapods-try          : 1.1.0

Podfile

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
use_frameworks!
workspace 'Recharge'

# ignore compiler warnings from Pods
inhibit_all_warnings!

target 'Consumer' do
  project 'consumer/Consumer.xcodeproj'

  # Local pods
  pod 'CommonAPI', :path => 'CommonAPI'

  # Third-party pods
	pod 'GoogleMaps'
	pod 'GooglePlaces'
	pod 'Alamofire'
	pod 'SwiftyJSON'
	pod 'ObjectMapper'
	pod 'PromiseKit/CorePromise'
	pod 'SwiftyUserDefaults'
	pod 'EmitterKit'
	pod 'Stripe'
	pod 'FBSDKCoreKit'
	pod 'FBSDKLoginKit'
	pod 'FBSDKShareKit'
	pod 'libPusher'
	pod 'RSKImageCropper'
	pod 'SDWebImage'
	pod 'KMPlaceholderTextView'
	pod 'libPhoneNumber-iOS'
	pod 'Mixpanel'
	pod 'CocoaLumberjack/Swift'
	pod 'LogglyLogger-CocoaLumberjack'
	pod 'Bugsnag'
	pod 'Sift'
	pod 'TTTAttributedLabel'
	pod 'pop'
	pod 'Branch'
	pod 'Firebase/Core'
	pod 'PureLayout'
	pod 'markymark', :git => 'https://github.com/edenman/Marky-Mark/', :commit => 'fcc845dc64388b14fbe3dce3b471bbfce47d1552'
	pod 'Reveal-SDK', :configurations => ['Debug']

	target 'ConsumerTests' do
		inherit! :search_paths
  end
end

target 'Taco' do
  project 'taco/Taco.xcodeproj'

  # Local pods
  pod 'CommonAPI', :path => 'CommonAPI'

  # Third-party pods
	pod 'Alamofire'
	pod 'SwiftyJSON'
	pod 'ObjectMapper'
	pod 'PromiseKit/CorePromise'
	pod 'SwiftyUserDefaults'
	pod 'EmitterKit'
	pod 'FBSDKCoreKit'
	pod 'FBSDKLoginKit'
	pod 'FBSDKShareKit'
	pod 'RSKImageCropper'
	pod 'SDWebImage'
	pod 'libPhoneNumber-iOS'
	pod 'Mixpanel'
	pod 'CocoaLumberjack/Swift'
	pod 'LogglyLogger-CocoaLumberjack'
	pod 'Bugsnag'
	pod 'pop'
	pod 'Branch'
	pod 'PureLayout'
	pod 'markymark', :git => 'https://github.com/edenman/Marky-Mark/', :commit => 'fcc845dc64388b14fbe3dce3b471bbfce47d1552'
	pod 'Reveal-SDK', :configurations => ['Debug']

	target 'TacoTests' do
		inherit! :search_paths
  end
end

Project that demonstrates the issue

WIP, I'll post a link when it's done

@dnkoutso dnkoutso added this to the 1.6.0 milestone Aug 21, 2018
@dnkoutso
Copy link
Contributor

Thanks for the report! Yeah a sample app would help here to figure this out. I'll try to use the Podfile you have in a sample app.

@edenman
Copy link
Author

edenman commented Aug 21, 2018

@dnkoutso
Copy link
Contributor

@edenman the sample project is missing Taco.xcodeproj

@dnkoutso
Copy link
Contributor

Commented out that target but Burrito does not use Firebase so build was successful. I will try it in a sample app of mine.

@dnkoutso
Copy link
Contributor

dnkoutso commented Aug 21, 2018

Can compile both Burrito and BurritoTests target (I copied over all pods from Taco into Burrito targets).

screen shot 2018-08-21 at 4 54 28 pm

I was using master (355bda2) but it only has 3 unrelated changes to 1.6.0.beta.1 so I don't think something has been fixed since then.

Would need an updated sample.

@dnkoutso dnkoutso added the s1:awaiting input Waiting for input from the original author label Aug 21, 2018
@stale stale bot removed the s1:awaiting input Waiting for input from the original author label Aug 21, 2018
@dnkoutso dnkoutso added the s1:awaiting input Waiting for input from the original author label Aug 21, 2018
@edenman
Copy link
Author

edenman commented Aug 22, 2018

errant .git folder caused taco to not get added. fixed now

@stale stale bot removed the s1:awaiting input Waiting for input from the original author label Aug 22, 2018
@dnkoutso
Copy link
Contributor

Definitely can repro. Probably related to new build settings. Tracked for 1.6.0.

@dnkoutso dnkoutso added t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome! s2:confirmed Issues that have been confirmed by a CocoaPods contributor labels Aug 22, 2018
@edenman
Copy link
Author

edenman commented Aug 22, 2018

Maybe worth noting: it's only repro-able if you use Firebase in the Taco app. If you remove the import and the call from AppDelegate, the tests work fine.

@paulb777
Copy link
Member

Please post the repro steps starting with git clone git@github.com:edenman/cocoapods-firebase-bug.git. Which workspace or project? Which build target? What other steps?

I see the same build issue in TacoTests with both 1.5.3 and 1.6.0.

@edenman
Copy link
Author

edenman commented Aug 23, 2018

  • git clone git@github.com:edenman/cocoapods-firebase-bug.git
  • cd cocoapods-firebase-bug
  • pod install
  • open Xcode, open cocoapods-firebase-bug.xcworkspace
  • run TacoTests in Xcode

@paulb777
Copy link
Member

With those steps, my 1.6.0 build gets further than the 1.5.3 one. 1.5.3 fails building the Taco target and 1.6.0 successfully builds Taco and fails building TacoTests.

@piercifani
Copy link

I'm also seeing something similar on my client's app (sorry but I had to redact the client's name)

This is with Xcode 10 & New Build System, but with Xcode 9.4 I'm seeing similar results.

The app's Podfile looks like this:

workspace 'AppName'
platform :ios, '9.0'
use_modular_headers!
inhibit_all_warnings!

target 'AppName' do
  
    pod 'RxCocoa'
    pod 'Firebase/Core'
    target 'Tests' do
		pod 'Nimble', '7.1.1'
        inherit! :search_paths 
    end
end

@Kalvin126
Copy link

Seeing this issue as well with Xcode 9.4 + CP 1.6.0.beta.1 :/

@JoeSzymanski
Copy link

I believe I'm seeing a similar issue in CP 1.6.0.beta.1 around running tests with use_frameworks!, though it seems like the tests work correctly using static rather than dynamic frameworks.

This also appears to work fine if the test target is a separate top-level target rather than chained inside the main target, but I ran into other issues with that pattern related to name spacing and Swift which means I cannot use that workaround.

Also, I had a case where I was able to revert the "Embed Pods Frameworks" build step for the Unit Test target and it worked again, which leads me to believe that there is some bug around linking dependencies into the test targets (but only when they are inside the main target).

@fonkadelic
Copy link

I've encountered the same problem. Looks like a regression of firebase/firebase-ios-sdk#16

I was able run the tests with the following workaround:

  • Change import Firebase to import FirebaseCore
  • Add "${PODS_ROOT}/FirebaseCore/Firebase/Core/Public" to your Tests target only under Build Settings -> Header Search Paths

@Kalvin126
Copy link

hm... adding "${PODS_ROOT}/FirebaseCore/Firebase/Core/Public" does not work for me this time arround :/

@ibuprofane
Copy link

Similar to fonkadelic's comment, I had to change all of my umbrella "import Firebase" statements to use the specific framework, e.g. (import FirebaseCore, import FirebaseAuth, import FirebaseRemoteConfig, etc.)

@paulb777
Copy link
Member

paulb777 commented Oct 25, 2018

The location of the Firebase.h and module.modulemap has changed from Firebase 4 to Firebase 5. The workaround would now be:

  • Add "${PODS_ROOT}/Firebase/CoreOnly/Sources" to your Tests target only under Build Settings -> Header Search Paths

To make sure to get the location right for the Firebase version do:

$ grep -r "module Firebase " *
Pods/Firebase/CoreOnly/Sources/module.modulemap:module Firebase {

@dnkoutso dnkoutso modified the milestones: 1.6.0, 1.7.0 Feb 6, 2019
@dnkoutso
Copy link
Contributor

dnkoutso commented Feb 8, 2019

I think this was duplicated by #8497.

Will verify #8497 fix and then see if it fixes this one as well and push this up to 1.6.1 instead.

@dnkoutso dnkoutso removed this from the 1.7.0 milestone Feb 8, 2019
@dnkoutso
Copy link
Contributor

dnkoutso commented Feb 8, 2019

Confirmed with #8500 that it fixes this issue.

@surbhiMagplus
Copy link

I've encountered the same problem. Looks like a regression of firebase/firebase-ios-sdk#16

I was able run the tests with the following workaround:

  • Change import Firebase to import FirebaseCore
  • Add "${PODS_ROOT}/FirebaseCore/Firebase/Core/Public" to your Tests target only under Build Settings -> Header Search Paths

Thanks buddy it solved my error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
Development

No branches or pull requests

9 participants