Perhaps this is a n00b question but I'm going to ask it anyways. I followed the instructions for adding Firebase to a Swift app via CocoaPods. Everything seems to have worked fine. Here is my Podfile:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'FirebaseDemo2' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for FirebaseDemo2
pod 'Firebase'
end
When trying to import the Firebase module into the AppDelegate, at first Xcode complains it cannot find it but the project builds just fine. However, when trying to add the FIRApp it then fails to build because it cannot find the class.
The Podfile is in the same directory as the .xcodeproj and I am opening the .xcworkspace file in Xcode. This is really confusing me. Can someone see what I am doing wrong? Is CocoaPods misconfigured?
I had the same problem, it installed 2.5.1 but you need 3.2.0
Try running
pod update Firebase
You should now have Firebase 3.2.0
I think your Podfile should look like this:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
use_frameworks!
target 'FirebaseDemo2' do
pod 'Firebase'
end
Make sure to open the Xcodeworkspace and not the Project
Related
I'm new to Xcode and Swift. Today I started a blank Tabbed Application with swift called "Test". I can build the blank project but as soon as I try to add Realm via CocoaPod it doesn't build anymore.
Error: Unknown property attribute 'class'
File: Test/Pods/Realm/Realm/RLMSyncSession.mm:73:12:
CocoaPod version: 1.2.0
Xcode version: Version 7.3.1
Realm: 2.4.3
I did the pod init/update/install
PodFile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Test' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Test
pod 'RealmSwift'
target 'TestTests' do
inherit! :search_paths
# Pods for testing
end
end
After the install I opened the "Test.xcworkspace" file and tried to build the project but it fails. How to fix that?
The issue came from an outdated version of Xcode.
This causes the OP to not achieve his build and Cocoapods setup after adding Realm to his project.
After updated it to the last version (8.2.1 I suppose), as recommended in the comment, the pod mechanism worked and the build could finally be achieved.
I am creating chatting app in Objective-C using XMPPFramework,
I have installed XMPPFramework using pod... pods got installed successfully but when i build my app after install it shows me this error Redefination of module dnssd
I did some research but havn't found any thing related to this.
Here is my pod file:
# Uncomment the next line to define a global platform for your project
platform :ios, ‘8.0’
target 'JabberClient' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
pod ‘XMPPFramework’
# Pods for JabberClient
end
Please help me where i am making mistake?
Thanks in advance !!
Try removing/commenting the use_frameworks! line.
It should be used if you're using Swift.
I am trying to create a project which uses Realm and RealmSwift. I have used Cocoapods to install these dependencies. I have seen the other posts too on stackoverflow and tried their solutions. They don't work for me. In my project, I'm getting the error "No such module as RealmSwift" when I write the import RealmSwift statement. Here are the steps I took for installation:
I created an empty xcode project
I went into terminal and navigated to my project directory
I gave the pod init command to create a pod file
I went into the pod file(it already had the use_frameworks! statement
I wrote in pod 'Realm' and pod 'RealmSwift'. I gave the sources as:
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
I wrote in pod install
The pods were installed successfully. I went into the .xcworkspace file.
I had already installed the realm plugin so I created a new realm object file
The template file opens with the following file. I'm getting the error that there is no RealmSwift module.
What am I doing wrong? Or what am I not doing? Is a bridging header required? Has anybody else managed to resolve this error?
Any relevant suggestions or insights are most welcome.
Its working now! Its so weird since I didn't do anything. I just went into my pod file commented out the use_frameworks! statement and ran pod update on the terminal. It gave me an error, so I added it back to my pod file. I wrote in pod update again and hit enter. I restarted Xcode cleaned it and built it and I wasn't getting this error anymore.
Need to uncomment platform in your pod file then try once again your pod.
# Uncomment this line to define a global platform for your project
platform :ios, '9.0' // Uncomment this
# Uncomment this line if you're using Swift
use_frameworks!
target 'Demo_Realm' do
pod 'RealmSwift'
end
target 'Demo_RealmTests' do
end
target 'Demo_RealmUITests' do
end
I am getting an error when building my app after i removed reference to a framework i added incorrectly. i am new to ios and cocoapods
/Users/MyMac/Library/Developer/Xcode/DerivedData/MyApp-ewxrexwuczochyctnqvlyusrtvvy/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Script-5874133373474758EEC76CFD.sh: line 2: /Users/MyMac/Documents/MyApp/Pods/Target Support Files/Pods-MyApp/Pods-MyApp-frameworks.sh: No such file or directory
I am aware that the file and directory don't exist and that is the way it should be but where is it finding the reference to this file so i can remove it and be rid of the error.
I have checked the following:
Linked Frameworks andLibraries under the general tab of my project
The frameworks group in the project
framework search paths under build settings tab
i have also run pod update after removing it from the pod file
How can i fix this?
Edit
back story
I was trying to add the framework https://github.com/Alliants/ALAccordion . in the instruction it said to use
# Podfile
target 'My Target' do
use_frameworks!
pod "ALAccordion"
end
so i added MyApp where my Target is and it created a framework named Pods-MyApp which i cant remove completely.
hope this helps
Cocoapods wrote a tool to completely deintegrate all of this stuff from your project so it goes back to running standalone. It sounds like you had an issue adding the correct target, so use this:
https://github.com/CocoaPods/cocoapods-deintegrate
Then try again so you can at least start from good ground. Hope this helps!
It happened with a prerelease version of Cocoapods 1.2.0.beta.1, by reverting to stable version and running pod install, then clean build, it worked.
why
use_frameworks!
after
target ... do
here is example
platform :ios, '8.0'
use_frameworks!
inhibit_all_warnings!
target 'XXX' do
pod 'RealmSwift'
end
target 'XXXTests' do
pod 'RealmSwift'
end
Following are the steps I did to add Parse using CocoaPods but still getting unresolved error.
Added Pods File:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
pod 'Parse'
target 'GroomCal' do
end
target 'GroomCalTests' do
end
target 'GroomCalUITests' do
end
After that I did pod install. Parse and Bolts frameworks got installed (I can see them in XCode).
I then added -Bridging-Header.h and added #import <Parse/Parse.h>to it.
When I try to import Parse in AppDelegate.swift file, I still get No such Module Parse error message. What am I missing here.
I did use the *.xcworkspace file to open the project too.
To use cocoapods with swift you need to add the flag
use_frameworks! to the podfile as swift doesn't allow to add static libraries.
source Cocoapods blog