I'm trying add add a pod by cocoapods, and I am using swift 3, while the pod(SQlite.swift).
I am trying to use doesn't have a master of the latest swift version, however there is a branch for swift 3.
So how should I set my podfile to download the specific branch? Is it possible?
Here is my podfile:
platform :ios, '10.0'
target 'RedShirt' do
use_frameworks!
# Pods for RedShirt
pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
The podfile guide mentions the following syntax:
To use a different branch of the repo:
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'dev'
^^^
(the space is important)
So in your case, that would be:
pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'swift3-mariotaku'
If you just want to use the main branch (master), write the following command:
pod "SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git'
But if you want to use an alternative/different branch, this one is for you:
pod "SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git', :branch => 'develop'
Easy peasy! 😊
Cocoapods with specific branch
[Cocoapods]
Use :branch in Podfile
pod "SQLite.swift", :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'dev'
//additionally you can use :tag, :commit
Please note, that branch must contain .podspec in root directory
When you specify :branch, Cocoapods will try to find .podspec directly there instead of searching in centralized repository
[Local CocoaPods]
Related
My "pods" after pod install are not recognised by Xcode and cause my build to failed.
This is the message I have while trying to opening pods from Pods/Pods.xcodeproj:
The project ‘Pods’ is damaged and cannot be opened. Examine the project file for invalid edits or unresolved source control conflicts.
This is my podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false
target 'applicationTemplate' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for applicationTemplate
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
pod 'RNFBAnalytics', :path => '../node_modules/#react-native-firebase/analytics'
pod 'RNFBApp', :path => '../node_modules/#react-native-firebase/app'
pod 'react-native-webview', :path => '../node_modules/react-native-webview'
pod 'react-native-voice', :path => '../node_modules/react-native-voice'
pod 'react-native-torch', :path => '../node_modules/react-native-torch'
pod 'RNKeychain', :path => '../node_modules/react-native-keychain'
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
pod 'RNCAsyncStorage', :path => '../node_modules/#react-native-community/async-storage'
pod 'RNOpenAppSettings', :path => '../node_modules/react-native-app-settings'
target 'applicationTemplateTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'applicationTemplate-tvOS' do
# Pods for applicationTemplate-tvOS
target 'applicationTemplate-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
# App Tracking Transparency https://rnfirebase.io/analytics/usage#disable-ad-id-usage-on-ios
$RNFirebaseAnalyticsWithoutAdIdSupport = true
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'react-native-config'
phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
phase.shell_script = "cd ../../"\
" && RNC_ROOT=./node_modules/react-native-config/"\
" && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
" && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"
target.build_phases << phase
target.build_phases.move(phase,0)
end
end
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
This is how I solved the issue:
Just removing this line: install! 'cocoapods', :deterministic_uuids => false and run pod deintegrate && pod cache clean --all && pod install
I added it because I was using react-native upgrade helper and I saw that in their podfile their was this line so I added it but apparently it does not work for every upgrade so be careful with upgrade helper.
I have a problem with my swift project on XCode. I use Cocoapods for the frameworks.
My project don't build. I have this error : No such module 'ObjectMapper'.
I have tried pod install, pod update, pod deintegrate, clean build folder, delete .xcworkspace file, delete derived data, update XCode, but nothing work.
The problem isn't the code because it had work well for this mac last week and today on other mac. It appeared after changing branches on my git.
Here is my pod file:
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
def pods
platform :ios, '13.2'
pod 'RESideMenu'
pod 'Alamofire', '~> 4.5'
pod 'AlamofireImage', '~> 3.1'
pod 'JSONHelper'
pod 'SwiftyJSON'
pod 'Google/Analytics'
pod 'ObjectMapper', '~> 3'
pod 'AlamofireObjectMapper', '~> 5.0'
pod 'RealmSwift', '~> 3.18.0'
pod 'KVNProgress'
pod 'CalendarLib'
pod 'Charts', '3.2.1'
pod 'SwiftEventBus', :tag => '2.2.0', :git => 'https://github.com/cesarferreira/SwiftEventBus.git'
pod 'RichEditorView', :git => 'https://github.com/T-Pro/RichEditorView.git', :branch => 'master'
pod 'SwiftHSVColorPicker'
pod 'Crashlytics'
pod 'Toucan'
pod 'RFQuiltLayout'
pod 'Kingfisher'
pod 'CropViewController', :tag => '2.4.0', :git => 'https://github.com/TimOliver/TOCropViewController.git'
pod 'MatomoTracker', '~> 7'
pod 'MaterialShowcase'
pod 'UIDeviceIdentifier', :git => 'https://github.com/squarefrog/UIDeviceIdentifier.git'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if ['RichEditorView', 'Toucan'].include? target.name
config.build_settings['SWIFT_VERSION'] = '4.0'
else
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end
target 'targetName' do
pods
end
I'm trying to build application from xcode.
I cloned the project from git repo.
I opened .xcodeproj file and from Product > Build I tried to build but build is failed.
From terminal I executed below commands and receiving compatible version error
I searched for solution and tried few ways like:
sudo gem intall cocoapods
sudo gem intall cocoapods --pre
pod setup
pod deintegrate
pod install
pod update
pod install --repo-update
Below is terminal output:
Analyzing dependencies
Pre-downloading: `BarcodeScanner` from `https://github.com/htothee/BarcodeScanner.git`
Pre-downloading: `MatrixKit` from `https://github.com/N-Pex/matrix-ios-kit.git`, branch `fix_apns_push`
Pre-downloading: `MatrixSDK` from `https://github.com/matrix-org/matrix-ios-sdk.git`, branch `develop`
Pre-downloading: `QRCode` from `https://github.com/brackendev/QRCode.git`
[!] CocoaPods could not find compatible versions for pod "MatrixSDK":
In Podfile:
MatrixKit (from `https://github.com/N-Pex/matrix-ios-kit.git`, branch `fix_apns_push`) was resolved to 0.10.1, which depends on
MatrixSDK (= 0.13.0)
MatrixSDK (from `https://github.com/matrix-org/matrix-ios-sdk.git`, branch `develop`)
Below is Podfile
platform :ios, '9.3'
use_frameworks!
def shared_pods
pod 'ProjectCore', :path => '../'
pod 'MatrixKit', :git => 'https://github.com/N-Pex/matrix-ios-kit.git', :branch => 'fix_apns_push'
pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop'
end
target 'Project_Example' do
shared_pods
pod 'BarcodeScanner', :git => 'https://github.com/htothee/BarcodeScanner.git'
pod 'QRCode', :git => 'https://github.com/brackendev/QRCode.git'
pod 'Project', :path => '../'
target 'Project_Tests' do
inherit! :search_paths
end
end
target 'ShareExtension' do
shared_pods
pod 'ProjectExtension', :path => '../'
end
Expected:
.ipa file need to be created
Please let me know how can I solve it.
same problem for me
CocoaPods could not find compatible versions for pod "Branch"
remove Podfile.lock and Pods then do pod install
rm -rf ./Pods Podfile.lock
pod install --repo-update
try this, this worked for me. Thanks.
Your problem is explained in the error:
[!] CocoaPods could not find compatible versions for pod "MatrixSDK":
In Podfile:
MatrixKit (from https://github.com/N-Pex/matrix-ios-kit.git, branch fix_apns_push) was resolved to 0.10.1, which depends on
MatrixSDK (= 0.13.0)
The branch fix_apns_push of MatrixKit needs a fixed version of MatrixSDK, as you can see in its Podspec file
pod 'MatrixSDK', '0.13.0'
So, In order for your project to work, you need this version.
Try this:
def shared_pods
pod 'ProjectCore', :path => '../'
pod 'MatrixKit', :git => 'https://github.com/N-Pex/matrix-ios-kit.git', :branch => 'fix_apns_push'
pod 'MatrixSDK', '0.13.0'
end
insted of projectname.xcodeproj, please try to open projectname.xcworkspace.
I am developing a React Native Application and I already managed to run it on android platform without any problem. However I got an error in xcode. It is building the project and running it but after I pass the firebase authentication part, it results in failure.
Failure:
*** Assertion failure in std::string firebase::firestore::remote::LoadGrpcRootCertificate()(), ..myProject/ios/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder_apple.mm:61
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: Could not load root certificates from the bundle. SSL cannot work. (expected path)'
My Podfile:
# File contents of "ios/Podfile"
platform :ios, '9.0'
target 'myProject' do
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
# the following ones are the ones taken from "Libraries" in Xcode:
'RCTAnimation',
'RCTActionSheet',
'RCTBlob',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]
# the following dependencies are dependencies of React native itself.
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
# your other libraries will follow here!
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
pod 'Firebase/Core', '~> 5.15.0'
pod 'Firebase/Auth', '~> 5.15.0'
pod 'Firebase/Firestore', '~> 5.15.0'
pod 'Firebase/Messaging', '~> 5.15.0'
pod 'Firebase/Database', '~> 5.15.0'
pod 'Firebase/Storage', '~> 5.15.0'
pod 'RNGoogleSignin', :path => '../node_modules/react-native-google-signin'
pod 'GoogleSignIn', '~> 4.4.0'
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler/ios'
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
#pod 'react-native-google-places', :path => '../node_modules/react-native-google-places' #there is no such .podspec file add manually
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'GooglePlacePicker'
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
end
# The following is needed to ensure the "archive" step works in XCode.
# It removes React from the Pods project, as it is already included in the main project.
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
install! 'cocoapods',
:deterministic_uuids => false,
:integrate_targets => false
Related questions that i couldn't find the solution:
https://github.com/firebase/firebase-ios-sdk/issues/2177
https://github.com/firebase/firebase-ios-sdk/issues/2385
''' I've been coresponding with the firebase-ios-sdk crew and I
believe we have dentified the issue, and have a workaround for now.
The issue: https://github.com/firebase/firebase-ios-sdk/issues/2604
The workaround: Locate the 'gRPCCertificates.bundle' file. Locate the
root.pem file inside it. Add the root.pem file to your ios app under
the project navigator. ENSURE its target membership is checked for
your app target. ENSURE under Build Phase, 'Copy Bundle Resources' for
your app target that 'root.pem' is added
Wouldn't hurt to clean the build folder probably. Build and run and
you should no longer see the error. (PS SO this is not code.) '''
Blockquote
PS SO, none of that resembles code in any way.
I 100% solved to problem
update your pods
then make sure to delete the app from the phone/simulator
and run the app and it will work fine
I'm trying to wrap my head around this complex setting:
I have two projects and a shared library. The shared library is a cocoapod.
I would like to be able to use a single workspace to develop in. There are some duplicated pod definitions, but I have this working in a single Podfile.
Here's where it gets complicated:
I want each project/library in its own git repo. Each repo must be able to live on its own; have its own Podfile, be tested/deployed via CI, etc.
Another wrench: we are the git-flow branching strategy... The master branch of project A/B must pull the master branch of the library. The develop branch of project A/B must pull the develop branch of the library.
Has anyone figured this out? Am I going about this in an ass-backwards way?
Here is a working root workspace Podfile:
platform :ios, "7.0"
inhibit_all_warnings!
workspace 'Root.xcworkspace'
xcodeproj 'SharedLibrary/SharedLibrary.xcodeproj'
xcodeproj 'ProjectA/ProjectA.xcodeproj'
xcodeproj 'ProjectB/ProjectB.xcodeproj'
target 'SharedLibrary' do
xcodeproj 'SharedLibrary/SharedLibrary.xcodeproj'
pod 'AFNetworking', '~> 2.0'
pod 'CocoaLumberjack'
end
target 'ProjectA' do
xcodeproj 'ProjectA/ProjectA.xcodeproj'
pod 'AFNetworking', '~> 2.0'
pod 'CocoaLumberjack'
pod 'MagicalRecord', '~> 2.2'
pod 'SharedLibrary', :path => './SharedLibrary/'
end
target 'ProjectB' do
xcodeproj 'ProjectB/ProjectB.xcodeproj'
pod 'AFNetworking', '~> 2.0'
pod 'CocoaLumberjack'
pod 'MagicalRecord', '~> 2.2'
pod 'SharedLibrary', :path => './SharedLibrary/'
end
Here is the shared library's podspec:
Pod::Spec.new do |s|
s.name = "SharedLibrary"
s.version = "0.0.1"
s.platform = :ios, "7.0"
s.source = { :git => "http://not.really.uploaded.anywhere.yet/SharedLibrary.git", :tag => "0.0.1" }
s.source_files = "SharedLibrary", "SharedLibrary/**/*.{h,m}"
s.public_header_files = "SharedLibrary/**/*.h"
s.dependency 'AFNetworking', '~> 2.0'
s.dependency 'CocoaLumberjack'
end
What I did was to define an "exclusive" target for the CocoaPod library. An exclusive target will not link with the rest of the Podfile pods. Basically what you're going to have to do is define your target that points to the Xcode project. Then you need to add the CocoaPod as a dependency using the podspec. Because it's an exclusive target, it won't link with itself. For example,
source 'https://github.com/CocoaPods/Specs.git'
target 'SharedLibrary', :exclusive => true do
xcodeproj 'SharedLibrary/SharedLibrary.xcodeproj'
end
pod 'SharedLibrary', :path => 'SharedLibrary/'
does what you would need it to. The only caveat is that every time you add a public header to the library, you need to run pod update to use it in your project.
Podfile Syntax on Targets