1

I'm trying to setup a new iphone app to play around with Firebase. I'm trying to use Cocoapods to import it, but I keep getting a

'No such module' error

The Firebase files are in the pods directory, but Xcode can't find them.

This is my Podfile:

platform :ios, '8.0'
use_frameworks!

target 'MyProj' do
  pod 'Firebase', '>= 2.4.3'
  pod 'Alamofire', '2.0.2'
end

target 'MyProjTests' do
end

target 'MyProjUITests' do
end

This is a basic hello world app, and the only code I have added is:

'import Firebase'
'import Alamofire'

I run 'pod install' with xcode closed. I launch the app with .xcworkspace

There is no Pods.xcconfig file.

Thanks!

Scott
  • 330
  • 3
  • 15
  • Can you post a "full Monte" Podfile? Verbatim cut & paste – Adrian Dec 04 '15 at 22:18
  • Skip down to the first section called "Install Your First Dependency" and give this a whirl. http://www.raywenderlich.com/97014/use-cocoapods-with-swift – Adrian Dec 04 '15 at 22:22
  • This is Podfile, cut and paste: platform :ios, '8.0' use_frameworks! pod 'Firebase', '>= 2.4.3' The same as above – Scott Dec 04 '15 at 22:29
  • I haven't messed w/ Firebase, but there are 2 things to check. 1) Make sure you've got the project closed when you're doing `pod install` and 2) Make sure you open the WORKSPACE, not the project after you install the pod. – Adrian Dec 04 '15 at 22:37
  • Thanks Adrian, I checked out the link and set up a new project exactly the way specified, and still get the same error – Scott Dec 04 '15 at 22:44
  • Thanks again, unfortunately, that's how I'm doing it. – Scott Dec 04 '15 at 22:46
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/97025/discussion-between-adrian-b-and-scott). – Adrian Dec 04 '15 at 22:52
  • If you're installing just Firebase, do you need 'pod 'Alamofire', '2.0.2' ` in the RW tutorial? – Adrian Dec 04 '15 at 22:55
  • Might want to take a peek at this post, too. http://stackoverflow.com/a/30248883/4475605 – Adrian Dec 04 '15 at 22:59
  • Thank you Adrian for your thoughtful comments. For the life of me, I have no idea why it wasn't working. After deleting the project and reinstalling the cocoapods gem and rebuilding everything multiple times, it is now working. I don't know why it is working or wasn't before, but, frankly, I'm just glad to move on. The link you posted was helpful in revealing how projects are configured. Thanks again. – Scott Dec 06 '15 at 15:53

1 Answers1

1

That podfile looks wonky for a brand new one. Are you using Swift?

Also, for a brand new project, you would not have 'AlamoFire' in the pod file.

I have had a couple of issues with Cocoapods so my first suggestion is to re-install it

sudo gem install cocoapods

Then, walk through the Firebase Guide to set up a new App. I just did the steps and it works correctly and sets up a pod file thats slightly different than yours.

iOS Quickstart

I modified my pod file as such:

target 'Swift Firebase Test' do

platform :ios, '8.0'
use_frameworks!
pod 'FirebaseOSX', '>= 2.4.2'

end

Be sure to change to your project directory before initializing Cocoapods in your project.

Once you've done that, compile the app and see if there are any errors.

oh - and ensure the AppDelegate.swift is correct.

import Cocoa
import Foundation
import Firebase

@NSApplicationMain
Jay
  • 34,438
  • 18
  • 52
  • 81
  • Thank you Jay for your help. After deleting the project and reinstalling the cocoapods gem and rebuilding everything multiple times, it is now working. I don't know why it is working or wasn't before, but, frankly, I'm just glad to move on. I've tested a number of different setups for the Podfile has all of the podfiles outside of the target blocks. This is a normal Gemfile setup. Ruby executes all gems outside of blocks and selectively executes the one inside them. Still I appreciate your help; thanks again. – Scott Dec 06 '15 at 18:43