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'
Related
I put new pods into project pod file and tried to install. Then I received this error in Terminal.
[!] CocoaPods could not find compatible versions for pod "xxxxxxxxxxxxxxx":
In Podfile:
xxxxxxxxxxxxxxx
Specs satisfying the `xxxxxxxxxxxxxxx` dependency were found, but they required a higher minimum deployment target.
Update the minimum iOS version to what's required by the requested podspecs. Add something like this to the Podfile:
platform :ios, '13.0'
I have written a flutter package for local use and I am trying to get the minimum deployment version working so that no devices < 11.0 can use it.
I have set the following in the library using xcode (never sure whether to use xCode or edit the files manually)
And also have edited the libraries ios/<LIBRARY_NAME>.podspec file manually to have the following
s.dependency 'Flutter'
s.platform = :ios, '11.0'
s.ios.deployment_target = '11.0'
When i ran pod install (also tried pub get) in the IOS directory of an app using the library it prints the following
[!] The platform of the target `Runner` (iOS 9.0) may not be compatible with `<LIBRARY_NAME> (x.x.x)` which has a minimum requirement of iOS 11.0.
And I have also set the app to have ios 9.0 (which should error) in the ios/Podfile
e.g.
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
When I run the app builds, installs and runs fine. I have also tried cleaning the pod cache in between pod installs.
Can somebody explain what I have done wrong or am missing, trial and error isn't really working when the builds are like 5-10 minutes :(
Also I don't really understand what s.platform = :ios, '11.0' is setting in the iOS podspec when there is also deployment_target?
Thanks
Change 9.0 to 11.0 in your pod file.
platform :ios, '11.0'
The tool involved is Xcode7.2, which is installed using CocoaPod
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
However, there is a large number of compilation errors as shown in the picture. Can I ask why are these errors?
The #selector special form was added in Swift 2.2, which is shipped with Xcode 7.3. You're using Xcode 7.2. You need to either upgrade Xcode, or use a slightly older version of AlamoFire.
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.
How and where can i found out which version of the frameworks is preferred to install via cocoapods for different iOS sdks?[some times it shows error incompatible version used]
For example I want to install Restkit.Which will be the statement i need to add in the pod as version number.How it can be identified?
Just have a look at their pod specification (e.g. pod spec for RestKit 0.20.0pre2). There are a couple of lines stating which platform this is based on
# Platform setup
s.requires_arc = true
s.ios.deployment_target = '5.0'
s.osx.deployment_target = '10.7'
So if you want to use RestKit 0.20.0pre2 in your project, you want to use the same settings as a minimum.