Has anyone gotten CocoaPods working with watchOS 2? I tried using ‘use_framework!’ with ‘platform :watchos, ‘2.0’ but it says "[!] Invalid Podfile file: Unsupported platform watchos2. Platform must be :ios or :osx.. Updating CocoaPods might fix the issue.”
I am on the latest version of CocoaPods.
CocoaPods released new version which is 0.38.0 and now supports watchOS 2.
http://blog.cocoapods.org/CocoaPods-0.38/
According to the blog above, deployment target can be set to watchOS 2 in Podspec.
Pod::Spec.new do |s|
# …
s.watchos.deployment_target = '2.0'
end
You can set target for watchOS 2 in Podfile with the version.
However, library has to set the deployment target explicitly, so you need to check whether it's supported for each library in Podspec.
The latest version of CocoaPods supports this.
If you just need to get a pod working on watchOS 2 (e.g. Parse), the you can simply use a Podfile such as this:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'MyApp' do
end
target 'MyApp WatchKit App' do
end
target 'MyApp WatchKit Extension' do
platform :watchos, '2.0'
pod 'Parse', '~> 1.11'
end
If however, you need to use the pod in multiple targets of different platforms (e.g. iOS and watchOS 2), things are slightly tricker. See this answer for more information.
CocoaPods currently doesn't support watchos. There is a work in progress issue here for adding support for it.
Related
I want to import a module from CocoaPods in my project which has the minimum deployment target set to iOS 9.0.
In my Podfile, I set the minimum deployment target for that specific framework to iOS 11 like this:
#CoreML
platform :ios, '11.0'
pod 'xxx', '1.0.0'
so that it would allow me to pod install.
The problem is when I import it in my file, I receive the following error:
Module file's minimum deployment target is ios11.0 v11.0.
How should I import it only if iOS 11 is available? I tried using
if #available(iOS 11, *) { ... }
and #available(iOS 11), but with no luck.
Podfiles don‘t support Pod-specific deployment targets. You can set a deployment target for all Pods and the resulting aggregate target like you did with platform :ios, 'x.y'
You could set a Pod-specific deployment target in the Podspec of your Lib: spec.ios.deployment_target = '11.0' -> But that wouldn’t help in your case.
It makes no sense to use a higher deployment target in your Podfile (11.0) than in your Project (9.0). These values should always be equal.
Solution: set platform :ios, '9.0' in your Podfile and conditionally import / use your 11.0-only Lib with #available and #available. You may also need to optionally link your lib under "Link with Libraries", see Apple Doc
If this doesn’t work for you, please share more information (full Podfile, Xcode & Cocoapods Version, Podspec of the Lib)
What is the way to integrate Alamofire with Swift 3.0 and also have to provide support for iOS 8 ? Is there any other option then Alamofire ?
Upgrading to the latest Cocoapods do like this
gem install cocoapods --pre
seems to solve the issue for my circumstance.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
above this line only specification use this alamofire platform if u want all platform then remove this platform line and second thing is deployment target select 8.0 so all platform in use alamofire.
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire', '~> 4.4'
end
In the Parse SDK update to 1.11.0 it says it supports watchOS and tvOS. I was wondering how I can add the frameworks to my watchOS app using Cocoapods. The pod file contains pod 'Parse' and I have run pod update then pod install but when I add a bridging header to the watchOS 2 Extension it says file not found.
Do you know what I should be doing?
Thank you
It seems like the QuickStart instructions have not been updated for watchOS 2. I couldn't find any information in the announcement either.
If you only need to use Parse on your WatchKit Extension target, then a simple Podfile similar to this will work:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'MyApp' do
end
target 'MyApp WatchKit App' do
end
target 'MyApp WatchKit Extension' do
platform :watchos, '2.0'
pod 'Parse', '~> 1.11'
end
However, if you need to use Parse in both your iOS target and the WatchKit Extension target (e.g. to register for Push Notifications on iOS and communicate with Parse on WatchKit), things are a bit more complicated.
Due to the "Generated duplicate UUIDs" bug in CocoaPods, you will need to work around the issue, by running this in your terminal first:
export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES
Next, you can create a Podfile such as this:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'MyApp' do
platform :ios, '8.0'
pod 'Parse', '~> 1.11'
end
target 'MyApp WatchKit App' do
end
target 'MyApp WatchKit Extension' do
platform :watchos, '2.0'
pod 'Parse', '~> 1.11'
end
Finally, pod install, and you should be good to go!
enter image description herewhen I am installing pod file for latest parse sdk by using the below syntax in podfile:
pod 'Parse'
pod 'Facebook-iOS-SDK'
pod 'ParseFacebookUtils'
pod 'ParseFacebookUtils'
pod 'ParseFacebookUtilsV4'
Getting error like ld: library not found for -lPods
Please help me.
Your podfile should have platform same as set in your Project target->General-> Deployment Info.
Like if deployment info is set to be 9.0, then add the line to your podfile.
platform :ios, '9.0'
This problem could happen in the latest React Native 0.63, which I had just experienced. RN 0.63 required iOS 10 or higher. The solution is just platform :ios in Podfile to 10 or higher.
I was running into this same issue, make sure that every Deployment Target in your project is at least 8.1 for every Project and Target.
This includes Pods > Build Settings > iOS Deployment Target, all Targets there, and your main Project and Targets.
For an iOS project that requires iOS 5.1 I want to include an Pod that requires at least iOS 6.0 (ARChromeActivity). When I'm trying to install this Pod I only get the message:
[!] The platform of the target `Pods` (iOS 5.1) is not compatible with `ARChromeActivity (1.0.0)` which has a minimum requirement of iOS 6.0.
How can I include this Pod in my project anyway and ignore the base SDK for this single Pod?
Disclaimer: The purpose of the podspec's platform attribute is to make sure the library isn't installed with a version of the OS it has not been tested on by its maintainers. That being said, in your Podfile you can simple change the platform requirements to what you want to emulate for example,
platform :ios, '6.0'
Obviously that is for all your pods not just a single one but you can see why that feature doesn't exist. In the newer versions of CocoaPods you actually don't need that line at all and it will detect your target version from your project, obviously since you're trying to use code that's not meant for the version you're using that wouldn't help you but it's typically quite useful.
Edit:
Alternatively you can edit the spec's source directly. In this case open ~/.cocoapods/master/ARChromeActivity/1.0.0/ARChromeActivity.podspec in some editor and change:
s.platform = :ios, '6.0'
to
s.platform = :ios, '5.0'
Then run pod install
The correct thing to do would be not to change s.platform in the Podspec but to fix the s.io.deployment target:
s.ios.deployment_target = '5.0'