I have one project which is using a few libraries. The libraries are installed with CocoaPods. In another project I have added the first project to so that it is the master project. When I run the master project, it shows that the headers cannot be found from the libraries that were installed by CocoaPods. I have added all paths to master project but it still can't find the headers in from the installed pods.
Xcode version: 9.2
This is my pod:
target 'XMPPNative' do
use_frameworks!
# 3.7 Stable Release
pod 'XMPPFramework', '~> 3.7.0'
end
Related
I'm working with MapBox Search API. To avail MapBox libraries -
Create a new Project in Xcode
Close that project and open that project folder in terminal
Run pod init
Add these to my Podfile -
target 'MapBox' do
use_frameworks!
pod 'MapboxSearchUI', ">= 1.0.0-beta.3", "< 2.0"
end
Run pod Install and got this -
Analyzing dependencies
Downloading dependencies
Using MapboxCommon (9.0.2)
Using MapboxMobileEvents (0.10.8)
Using MapboxSearch (1.0.0-beta.4)
Using MapboxSearchUI (1.0.0-beta.4)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 4 total pods installed.
But I'm getting error
I checked in pods targets and found out that only one pod listed in targets and rests are not -
Targets list in Xcode -
And installed pod list in projects pod directory -
So How can I add the other pods in Xcode Targets?
N.B: I've found this similar question but there are no answares in that and that question is not that elaborative.
I want to use MapBox Search SDK for iOS. So I've followed this official documentation
Firstly, I've created ".netrc" in my /home directory as instruction and then add this -
use_frameworks!
target "TargetNameForYourApp" do
pod 'MapboxSearchUI', ">= 1.0.0-beta.3", "< 2.0"
end
to podfile. Then run pod install and got this in terminal -
Analyzing dependencies
Downloading dependencies
Installing MapboxCommon (9.0.2)
Installing MapboxMobileEvents (0.10.8)
Installing MapboxSearch (1.0.0-beta.4)
Installing MapboxSearchUI (1.0.0-beta.4)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `MapBox.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 4 total pods installed.
[!] Automatically assigning platform `ios` with version `12.1` on target `MapBox` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
But after running all this I'm getting this error in Xcode -
Framework not found MapboxCommon.xcframework
I've also tried this -
pod deintegrate && pod cache clean --all
pod install
but still the same error.
I think I've followed correctly the documentation and entered the secret API Key correctly. So why am I getting this error?
Edit:
In Project Targets the installed pods are not listed -
But In pod folder in Project directory -
there are other frameworks available which are not available in Xcode Pods Target.
Is that the pointing that the frameworks are not available in the projects?
Edit:
I've checked in my project directory if the Mapbox.common.xcfreamework present or not. And I found that file under pod/mapboxCommon folder
I've been opening my project using MapBox.xcworkspace which file was generated after running pod install.
You are facing this error because you are still trying to build the project file (xcodeproj), not the generated workspace by CocoaPods.
To resolve this issue, open up 'MapBox.xcworkspace' file and use that file to access your projects from now on.
I am attempting to use the MetaWear cocoapod to connect to BLE sensors from my IOS application. Before adding this pod, I created a basic Single View Application in Xcode. I tried to compile and run it on my iPhone, and it showed up as expected.
Having done this, I did a pod init, and updated my Podfile to look as follows, as recommended in the above MetaWear cocoapod link:
platform :ios, '12.2'
target 'myProj' do
use_frameworks!
pod 'MetaWear', '~> 3.2'
end
Once I run "pod install", I get the following output:
Analyzing dependencies
Downloading dependencies
Using Bolts-Swift (1.4.0)
Using MetaWear (3.2.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.
I then open my Xcode project ( myApp.xcworkspace ), and when I try to re-build the project, I keep getting this error:
Could not build Objective-C module 'BoltsSwift'
This is also shown in the following image:
As a result, I was under the impression that maybe I should downgrade the BoltsSwift version, but specifying something lower than 1.4, seems to be ignored. For example, I added this pod:
pod 'Bolts-Swift', '~> 1.3'
And my output after running pod install, still yielded "Using Bolts-Swift (1.4.0)". So I am not too sure how to get rid of this compilation failure. Maybe downgrading BoltsSwift is not the correct course of action. What can I try? (I am using Xcode Version 10.2.1 (10E1001))
Ok, turns out that by default, XCode set my Swift compilation to 5.0 for the BoltsSwift and MetaWear pod. I changed it to Swift 4, and I was able to build.
Updating the pods compilation level might also be a good idea, as described here :
How to set the Legacy Swift Version for each Pod in Podfile Xcode 9.0 Swift 3.2 / Swift 4.0
My project in Xcode consist of static frameworks and one custom dynamic framework. This dynamic framework includes some other static frameworks.
When I try to compile the custom dynamic framework itself, everything is fine. I was able to force to install latest version of frameworks (Alamofire, Realm, etc..) by forcing the pod definition file
platform :ios, '9.0'
But when I compile my project even when I use the above line, I am getting the old frameworks.
When I try to force the pods for a explicit version,
pod 'Alamofire', '~> 4.4.0'
getting the version 3.5.1.
Is there any other explicit setting to force CocoaPods to be more accurate in versions?
Originally the project for the dynamic framework was made for the Swift version 2.3, which is actually requiring the version of Alamofire 3.5.1.
Any help will be appreciated.
Maybe try the following in your podfile:
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => '4.4.0'
That will bypass your local spec repo and get straight from git.
Which version of CocoaPods you have currently installed on your machine? Which version was used to originally establish Pods in project? I've spotted an issue when I updated CocoaPods, that pod update hasn't been working properly, and removing just Podfile.lock and Pods/ directory wasn't sufficient to make things right.
That said I would do the following:
update CocoaPods to newest version
pod repo update for newest Pod specs
pod deintegrate to completely remove Pods from project
pod install to re-create Pods in the project
The solution is kinda tricky. I haven't realise in the beginning that the pods under a dynamic framework cannot actually be executed directly from top project and there is a configuration JSON file, which actually is managing the pods under the dynamic framework.
So the pod versions were actually hardcoded there.
I'm trying to integrate a new project into an Xcode workspace with dependencies handled by Cocoapods. I added the Backend project (builds fine on itself, returns a framework as a product) to the workspace and added a separate target in the Podfile:
target 'Backend' do
(Pod list here)
end
Yet when trying to run pod install, I get [!] Unable to find a target named 'Backend'.
Using Xcode 7.2, Cocoapods 0.39.0
CocoaPods doesn't support integrating with frameworks, see https://github.com/CocoaPods/CocoaPods/issues/3440