Scott
Scott

Reputation: 330

Correctly Setting Up Cocoapods

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!

Upvotes: 1

Views: 312

Answers (1)

Jay
Jay

Reputation: 35648

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

Upvotes: 1

Related Questions