CocoaPods could not find compatible versions for pod "MatrixSDK" - xcode

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.

Related

FIRESTORE INTERNAL ASSERTION FAILED: Could not load root certificates from the bundle. SSL cannot work

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

Cocapods -Can't Update pod ObjectMapper to version 3.3 error [!] Unknown command: `ObjectMapper,`

I just updated to Xcode 10.1 Swift version 4.2.1 and I have several build errors of:
Invalid redeclaration of '<~'
I followed this GitHub q&A and this one that says I need to update the ObjectMapper pod to version 3.3
I didn't see the ObjectMapper inside the regular Podfile however I saw it inside the Podfile.Lock and the version is - ObjectMapper (2.2.9)
I then went to terminal and tried all of these to update to 3.3 but none of them worked:
$ pod repo update
$ pod update
$ pod update ObjectMapper
$ pod 'ObjectMapper', '~> 3.3'
$ pod 'ObjectMapper', '3.3'
In terminal I keep getting:
Why do I keep getting this error?
Here is the regular podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'MyProject' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyProject
pod 'Stripe'
pod 'AFNetworking'
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'SDWebImage'
pod 'Fabric'
pod 'Crashlytics'
pod 'KeychainSwift'
pod 'IQKeyboardManagerSwift'
pod 'DLRadioButton', '~> 1.4'
pod 'GoogleInterchangeUtilities'
pod 'GoogleNetworkingUtilities'
pod 'GoogleParsingUtilities'
pod 'GoogleSymbolUtilities'
pod 'GoogleUtilities'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Storage'
pod 'Firebase/Crash'
pod 'Firebase/Messaging'
pod 'FirebaseInstanceID', '3.2.0'
pod 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'
pod 'GooglePlacesAPI'
pod ‘GoogleMaps’
pod 'GooglePlaces'
pod 'GooglePlacePicker'
pod 'ReachabilitySwift'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
end
end
end
end
I had to remove all the pods from my project then reinstall them.
First run the below code because you have to install the cocoapods-clean plugin to run pod clean.
$ sudo gem install cocoapods-clean
Second I copied all the pods from my podfile and placed them in a temporary different file then I ran the below 3 commands to remove all the pods:
$ pod deintegrate
$ pod clean
$ rm Podfile
After it was clean using the above 3 commands I then ran pod init to create a new Podfile, opened it, and pasted the saved pods from the temporary file. I also added the below ObjectMapper pod to the Podfile:
$ pod 'ObjectMapper'
Then I ran pod install to install everything
After everything was done I ran $ vim Podfile.lock and the ObjectMapper now had a version of:
- ObjectMapper (3.4.1)

How to install a pod from a specific branch?

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]

Cocoapods pod install gives undefined method inherit

I am getting this wierd error. If I look at the cocoapod specs, this seems like a valid syntax. What am I doing wrong.?
[!] Invalid `Podfile` file: undefined method `inherit!' for #<Pod::Podfile:0x007fad141d1050>. Updating CocoaPods might fix the issue.
# from /Users/Downloads/EarlGrey-master/Demo/EarlGreyExample/Podfile:28
# -------------------------------------------
# target TEST_TARGET do
> inherit! :search_paths
# pod 'EarlGrey'
Open your Podfile and Remove Project_Tests block.
for example,
Following Gives Error :
use_frameworks!
target 'MyPodProject_Example' do
pod 'MyPodProject', :path => '../'
target 'MyPodProject_Tests' do
inherit! :search_paths
end
end
Successful:
use_frameworks!
target 'MyPodProject_Example' do
pod 'MyPodProject', :path => '../'
end
Then do pod update (in terminal). This will create the .xcworkspace
Make sure you have the latest version of Cocoapods installed.
As mentioned by Zoidberg, you need to have at least version 1.0 (which is now stable) in order to support 'inherit'.
sudo gem install cocoapods
With this your pod install should not give you any errors.
I face a similar problem, here is what worked for me
sudo gem install cocoapods --pre
this will basically install the 1.0.0.beta.6 version of cocoapods which has 'inherit'

CocoaPods - use specific pod version

I am using CocoaPods for a macOS app. I have compilation errors with AFNetworking (current version, 1.2.1) and saw that these didn't exist in the previous version (1.2.0).
I did some research but did not find a possibility to define the version of a pod (for example, version 1.2.0 instead of 1.2.1).
Is this possible or do I have to wait until there is a new version of that library?
In your Podfile:
pod 'AFNetworking', '1.2.0'
Check 'Get started' at http://cocoapods.org
Once this is done, you can then issue a pod update in the terminal for the change to take place. Of course, this needs to be done from your project's top level folder. If the update does not occur, edit your Podfile.lock file and change the AFNetworking version # to something less than what it is and issue a pod update in the terminal again. This tells CocoaPods that you have a different version installed and that it must update.
Here, below mentions all possible ways to install pod with use cases.
To install the latest pod version, omit the version number after pod name.
pod 'Alamofire'
To install specific pod version, specify pod version after pod name.
pod 'Alamofire', '5.0.0'
Besides no version, or a specific one, it is also possible to use logical operators:
'> 0.1' Any version higher than 0.1
'>= 0.1' Version 0.1 and any higher version
'< 0.1' Any version lower than 0.1
'<= 0.1' Version 0.1 and any lower version
To install latest pod subversion of specified pod version :
pod 'Alamofire', '~> 0.1.2'
'~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher
'~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher
'~> 0' Version 0 and higher, this is basically the same as not having it.
To use pod from a local machine folder path:
pod 'Alamofire', :path => '~/Documents/Alamofire'
Install pods from the remote master branch
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git'
Install pods from the remote specific branch
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'dev'
Install pods from the specific tag on the remote branch
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => '3.1.1'
Install pods from the specific commit on the remote branch
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :commit => '0f506b1c45'
To know more in details, check reference: Cocoa pods installation guideline
In your podfile, write :
pod 'podname', 'desired version'.
Close the Project
Run pod update or pod install (as applicable) to get the pods as mentioned in above step.
Compile the code with your desired pod version.
Use platform :ios, '8.0'. It will automatically install the previous one which will run on this platform

Resources