Podfile Syntax reference “Platform” in iOS - ios

Now i am working on Xcode 7.2 with iOS version 7.2 .My application uses one library implemented by cocoapod file.I need to update this podfile using “pod update” command in terminal.My client wants to this application deployment target to 7.0. When i am going to update podfile i am confused about this line of code like platform :ios, "5.1.1" .How to write this line pod file like platform :ios, “7.0” or platform :ios, “9.2” ?

Related

use_framework errors in iOS

I'm a flutter developer and I don't have much idea about iOS. I'm facing errors for the last 2-3 days in two packages. The flutter packages which I am using are - razorpay_flutter: ^1.2.7 and image_cropper: ^1.4.1 .
Now, razorpay_flutter is required to set use_frameworks! in Podfile else, it will give a file not found an error as shown in the screenshot.
On the other hand, the image_cropper packages use TOCropViewController iOS package which throws errors when we add use_frameworks! in Podfile. Check the below screenshot.
Also, there is an issue created on GitHub where people instructed not to add use_framework in Podfile but it is required for the Razorpay package.
The minimum deployment target shouldn't be less than iOS 10.0. If it is then go to "Podfile" and add this line and save the changes:
platform :ios, '10.0'
Then run pod install in the project directory i.e ios

Minimum iOS deployment version of flutter package

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'

Realm Swift: Realm Build Errors After Linking

I've created a new project MyApp, added a Podfile as follows:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target ‘Coffee’ do
pod 'QuadratTouch', '>= 1.0'
pod 'RealmSwift'
end
Then, I closed the project, run pod install from the command line and everything was installed correctly. I then opened the workspace and built the project (cmd+b) and was hit with 44 errors originating from Realm.
Any help on this would be appreciated. Thanks.
Xcode: v 7.2.1
iOS: 9.0
Mac: OSX El Capitan
The latest version of Realm (1.0.1) requires Swift 2.2 which is a part of Xcode 7.3. So you should update Xcode to the latest version.
Realm Swift 0.102.1 was the last version to support Xcode 7.2.1.

Getting started with Firebase, iOS and Swift

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

How to ignore the Base SDK for a single pod

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'

Resources