I have been working with googles map SDK and I haven't had any problems until I added another dependency in my podfile. I get this error in Xcode saying, "Module 'Google Maps' not found" where I have '#import GoogleMaps'. If I take out the new pod the error goes away and everything works fine. I just recently started using cocoaPods, Is there something I'm missing in my podfile?
platform :ios, '6.1'
pod 'SDWebImage', '~>3.7'
source 'https://github.com/CocoaPods/Specs.git'
pod 'GoogleMaps'
You just have to add
target 'Your Project' do
pod 'SDWebImage', '~>3.8'
pod 'GoogleMaps'
target 'Your ProjectTests' do
# Pods for testing
end
The project will run fine now..
Related
I am refactoring a monolithic codebase and want to split it into frameworks, my current situation is as follows:
App Project, depends on A, B and C
Framework A
Framework B, depends on A
Framework C, depends on A and B
All the above are in the same workspace, and each has his own pods:
App uses Firebase, Cryptoswift and RxSwift
Framework A uses Firebase and RxSwift
Framework B and C use RxSwift
Everything works fine, but at app launch, I see in the log that there are multiple (two) definitions for each framework, for example:
RxSwift is implemented in both 'app' and 'frameworka', which implementation will be used is undefined
(Tried both "Do no Embed" and "Embed & Sign")
Any ideas?
I am also fine switching to some other package manager if it helps solve the problem...
Thanks in advance!
My Podfile looks something like this:
platform :ios, '11.0'
use_frameworks!
workspace 'App'
project 'App/App'
project 'FrameworkA/FrameworkA'
project 'FrameworkB/FrameworkB'
project 'FrameworkC/FrameworkC'
target 'Appp' do
project 'App/App'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
pod 'Firebase/RemoteConfig'
pod 'CryptoSwift'
pod 'RxSwift'
pod 'RxCocoa'
end
target 'FrameworkA' do
project 'FrameworkA/FrameworkA'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Analytics'
pod 'Firebase/RemoteConfig'
pod 'RxSwift'
pod 'RxCocoa'
end
target 'FrameworkB' do
project 'FrameworkB/FrameworkB'
pod 'RxSwift'
pod 'RxCocoa'
end
target 'FrameworkC' do
project 'FrameworkC/FrameworkC'
pod 'RxSwift'
pod 'RxCocoa'
end
After some trial and error I did not find a solution to this.
I just ended up moving to Swift Package Manager, which does throw a compiler error (instead of just a line in the console log) when duplicated dependencies are found.
I then realized I could remove the dependencies and that's it.
I'm trying to add firebase to an existing project but I keep getting errors on building and after a couple of days searching the internet I have not yet fixed the issue :(
I've tried adding --deep to the signing flags, locking and unlocking the keychain, switching to use_modular_headers! in the Podfile.
I don't have a physical device to test on.
My Podfile looks like this:
# Uncomment the next line to define a global platform for your project
#platform :ios, '12.0'
target 'EyeArtifact' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
use_modular_headers!
# Pods for EyeArtifact
pod 'Firebase'
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
pod 'FirebaseUI'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/Facebook'
pod 'FirebaseUI/OAuth'
pod 'FirebaseUI/Phone'
pod 'FirebaseFirestoreSwift'
# Facebook pods
pod 'FBSDKCoreKit', :modular_headers => true
pod 'FBSDKLoginKit', :modular_headers => true
end
and my error is:
/Users/jvines/Library/Developer/Xcode/DerivedData/***-bgaqkzrrqevduaadrswisdyouwqv/Build/Products/Debug-iphonesimulator/***.app/Frameworks/AppAuth.framework: replacing existing signature
/Users/jvines/Library/Developer/Xcode/DerivedData/***-bgaqkzrrqevduaadrswisdyouwqv/Build/Products/Debug-iphonesimulator/***.app/Frameworks/AppAuth.framework: code object is not signed at all
In architecture: x86_64
If I switch between use_frameworks! and use_modular_headers! I get another error: BoringSSL-GRPC.modulemap' not found when building
I've tried disabling the signing script when building but then if I run the app I get this error: dyld: Library not loaded: #rpath/AppAuth.framework/AppAuth
The simulator is running iOS 14.2 and I'm using Xcode 12
I also tried a brand new project and adding the frameworks from scratch but I encountered the same errors.
I'm new to iOS development so any help is greatly appreciated!
Thank you :)
Found the answer to my problem here: https://stackoverflow.com/a/62172769/14828440
In short I was missing the bridging header even though I don't have any swift files.
I wonder if anyone of you have tried the database quickstart sample provided by Firebase.
https://github.com/firebase/quickstart-ios/tree/master/database
I am able to run the Objective-C part but when I tried to target the Swift part, there is this error message: Firebase module is not available.
I am not too sure what I did wrong and if you have successfully targeted and ran the Swift part, may be you could give me some hints.
The pod file was included in the sample which is as shown below:
# DatabaseExample
use_frameworks!
platform :ios, '7.0'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'FirebaseUI'
target 'DatabaseExample' do
end
target 'DatabaseExampleSwift' do
end
target 'DatabaseExampleTests' do
end
The pod declarations should be inside your target like so:
platform :ios, '7.0'
target 'DatabaseExample' do
use_frameworks!
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'FirebaseUI'
end
target 'DatabaseExampleSwift' do
end
target 'DatabaseExampleTests' do
end
I'm recently learn iOS and I want to install the GoogleMap SDK for iOS in my project.
But when I installed with pod install it got an error say that the 'GoogleMaps' doesn't have concrete dependency ... or some thing like that.
I did as the instruction on the GoogleMapsAPI web source and this is my Podfile
'https://github.com/CocoaPods/Specs.git'
pod 'GoogleMaps'
Please tell me where do I did wrong. Thanks
You have to specify a target for each pod.
e.g. if before you had your Podfile written like this:
pod 'GoogleMaps'
just change it to
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
target "TargetName" do
pod 'GoogleMaps'
end
When you are working with latest pod you need to write Target in Pod file
Like below.
Currently your pod file looking like
pod "YOUR_POD"
Change To
target "Your_Target_Name" do
pod "YOUR_POD"
end
I'm working on a larger project(Swift) with some Pods and everything was fine so far...
Bu now I wanted to add a tvos target and now my project is messed up :(
And there is an easy way to reproduce:
1.) create a new SingleView Application and name it "pod-test" in Xcode
2.) open it an run it
3.) run pod init to create the Podfile
4.) Edit the Podfile with this:
use_frameworks!
platform :ios, '8.0'
pod 'Alamofire'
pod 'ObjectMapper'
pod 'AlamofireObjectMapper'
pod 'Fabric'
pod 'Crashlytics'
pod 'Nuke'
pod 'MGSwipeTableCell'
pod 'GradientCircularProgress', :git => 'https://github.com/keygx/GradientCircularProgress'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
5.) run pod install
6.) open workspace project file an run the application
7.) now add the twos target and name it "pod-test-tvos"
8.) run iOS and tvos app. Everything still fine
9.) edit the Podfile with this:
source 'https://github.com/CocoaPods/Specs.git'
target 'pod-test' do
use_frameworks!
platform :ios, '8.0'
pod 'Alamofire'
pod 'ObjectMapper'
pod 'AlamofireObjectMapper'
pod 'Fabric'
pod 'Crashlytics'
pod 'Nuke'
pod 'MGSwipeTableCell'
pod 'GradientCircularProgress', :git => 'https://github.com/keygx/GradientCircularProgress'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end
target 'pod-test-tvos' do
use_frameworks!
platform :tvos, '9.0'
pod 'Fabric'
pod 'Crashlytics'
end
10.) Edit configuration for pod-test and pod-test-tvos to none
10.) close XCode
11.) run pod install again
12.) Open Xcode again
13.) run iOS and TVOS apps again... Still everything is fine
14.) edit "AppDelegate" for both targets and add just this import:
import Fabric
15.) run iOS and TVOS apps again... and boom... iOS runs fine TVOS says Fabric is not found :(
This all just happens, because I "changed" the Podfile after adding the TVOS target...
With just this steps everything is fine:
1.) create a new SingleView Application and name it "pod-test" in Xcode
2.) now add the twos target and name it "pod-test-tkos"
3.) run pod init to create the Podfile
4.) edit the Podfile with this:
source 'https://github.com/CocoaPods/Specs.git'
target 'pod-test' do
use_frameworks!
platform :ios, '8.0'
pod 'Alamofire'
pod 'ObjectMapper'
pod 'AlamofireObjectMapper'
pod 'Fabric'
pod 'Crashlytics'
pod 'Nuke'
pod 'MGSwipeTableCell'
pod 'GradientCircularProgress', :git => 'https://github.com/keygx/GradientCircularProgress'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end
target 'pod-test-tvos' do
use_frameworks!
platform :tvos, '9.0'
pod 'Fabric'
pod 'Crashlytics'
end
5.) run pod install
6.) open workspace project file an run the application
7.) edit "AppDelegate" for both targets and add just this import:
import Fabric
8.) run iOS and TVOS apps again... Still everything is fine
So, there seems to be a problem with changing the Podfile in an "older" Project...
I hope somebody can help me out with this :)
This can be resolved by using the deintegrate command in Cocoapods 1.0.
Close Xcode
Open Terminal and navigate to the directory that contains your Podfile.
pod deintegrate
pod install
Open your workspace in Xcode and build.
I had exactly the same problem. I don't know why. Inspired by your experimentation, I downloaded the Cocoapods app, and used it to remove Cocoapods from my project. I then reinstalled cocoapods and now it works just fine.