Trying to install Mapbox pods for xCode breaks existing pods - swift

I am playing with a navigation app in swift to learn mapbox. I ran into an issue while adding a Textbox which is supposed to use the MapboxSearchUI pod, because I can't install it. My Terminal gives me some errors, I am thinking the versions could be incompatible. Somehow, the pod install lines from mapbox itself don't work together. The Pods I used to use and which worked fine:
pod 'Mapbox-iOS-SDK', '~> 6.3.0'
pod 'MapboxNavigation', '~> 1.4.2'
The Pod I am trying to add which breaks my pod install:
pod 'MapboxSearchUI' , ">= 1.0.0-beta.9", "< 2.0"
I copied it straight from their website. Terminal gives me this:
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "MapboxMobileEvents":
In snapshot (Podfile.lock):
MapboxMobileEvents (= 0.10.8, ~> 0.10.2, ~> 0.10.4)
In Podfile:
MapboxSearchUI (< 2.0, >= 1.0.0-beta.9) was resolved to 1.0.0-beta.9, which depends on
MapboxSearch (< 2.0, >= 1.0.0-beta.9) was resolved to 1.0.0-beta.9, which depends on
MapboxMobileEvents (~> 1.0.2)
Specs satisfying the `MapboxMobileEvents (= 0.10.8, ~> 0.10.2, ~> 0.10.4), MapboxMobileEvents (~> 1.0.2)` dependency were found, but they required a higher minimum deployment target.
Does anyone know what causes the issue and maybe what version I could use? I usually don't use the terminal therefore can't really use trial and error. Removing the version behind the Maobox Search didn't work though.
Thanks!

So for everyone having the same Issue, here is how I ended up fixing the installation 5 days later, having still not gotten any answer from the support...
Even though on many Installation guides (From mapbox themselves) the pod line is always stated as
pod 'MapboxSearchUI', ">= 1.0.0-beta.9", "<2.0"
this leads to version issues, because of the beta.9 part.
Solution:
pod 'MapboxSearchUI', ">= 1.0.0-beta", "<2.0
This works as it should. This has taken me significantly longer than I'd like to admit. Hope this helped someone.

I also ran into the same issue and removing the explicitly declared Pod versions from the Podfile resolved the issue.
In your Podfile, remove the versions in front of the pod name.
pod 'Mapbox-iOS-SDK', '~> 6.3.0'
pod 'MapboxNavigation', '~> 1.4.2'
i.e. It should be updated as follows.
pod 'Mapbox-iOS-SDK'
pod 'MapboxNavigation'

Related

Trying to install GeoFire through Cocoapods, but getting Objective-C Module error

So there is an odd build issue I’m encountering.
I have an existing Xcode project where all my packages have been added through Xcode itself (I think Xcode basically uses Swift Package Manager underneath).
I came to a point where I needed to now use GeoFire . But Geofire needs to be installed through Cocoapods. But my Xcode project never used cocoapods.
So to integrate Cocoapods I did the following:
brew install cocoapods
opened terminal and navigated to root directory of iOS app (where <app-name>.xcodeproj exists)
pod init
opened the generated Podfile and added the following:
…
platform :ios, '11.0’
…
pod 'GeoFire', '~> 4.0’
…
pod install
opened <app-name>.xcworkspace
Then when I went to build the project, the following failure occurred (see image attached to question)
None of the workarounds suggested have helped me thus far. Any thoughts?
NOTE: I am doing all this on an M1 Macbook.
Wow, strange issue.
What ended up fixing it for me was to go to my pod file and replace:
pod 'GeoFire', '~> 4.0'
With:
pod 'GeoFire/Utils'
Now I can use GeoFire in my file as I wish.

Error installing AFNetworkActivityLogger with AFNetworking 4.0 - Cocoapods

I get this message after submitting my app to App Store Connect.
ITMS-90809: Deprecated API Usage — Apple will stop accepting
submissions of apps that use UIWebView APIs When upload myApp
It tells me that my project is using WebView (deprecated library). I found the problem in AFNetworking library, after going to this page they report that version 4.0 this problem was corrected, so when I update my pod and run the pod install I receive the following error.
[!] CocoaPods could not find compatible versions for pod "AFNetworking/NSURLSession":
In snapshot (Podfile.lock):
AFNetworking/NSURLSession (= 4.0.1)
In Podfile:
AFNetworkActivityLogger (from `https://github.com/AFNetworking/AFNetworkActivityLogger.git`, branch `3.0.0`) was resolved to 3.0.0, which depends on
AFNetworking/NSURLSession (~> 3.0)
Specs satisfying the `AFNetworking/NSURLSession (= 4.0.1), AFNetworking/NSURLSession (~> 3.0)` dependency were found, but they required a higher minimum deployment target.
I really don't understand why or how to fix it, I already checked the AFNetworkActivityLogger Git project since here the cocoapods indicates that problem. On their page they mention that the problem is resolved in an update, however I cannot update this library so I got stuck at this point. I hope you help me, thanks in advance.
I share my pod so they can review it.
platform :ios, '10.3'
inhibit_all_warnings!
use_frameworks!
end
def common_pods
pod 'AFNetworking', '~> 4.0'
pod 'AFNetworkActivityLogger', :git => 'https://github.com/AFNetworking/AFNetworkActivityLogger.git', :branch => '3.0.0'
end
target 'PardosChicken' do
common_pods
end
target 'PardosChickenTests' do
pod 'OCMock'
pod 'Specta'
pod 'Expecta'
end
The PR you reference with the fix has not yet been merged. To point to the PR directly do:
pod 'AFNetworkActivityLogger', :git => 'https://github.com/ToshMeston/AFNetworkActivityLogger.git'

When I compile the application I get an error equal to this: Could not build Objective-C module 'Firebase'

None of my 'Firebase' pods are found.
I updated to Xcode 9.
Ran 'pod update'
deitegrated my pods, and re-installed
Deleted 'Derived Data' folder contents
Build from 'Generic Devices'
Added the paths in the Header Search Path in the Build Settings $(inherited)
and
"$(SRCROOT)/Pods"
and
"${PODS_ROOT}/Firebase/Core/Sources"
Cleaned, build, closed the app, re-installed Xcode, restarted the system, and did it all again.
2 Swift Compiler Errors are always there.
'FirebaseAnalytics/FirebaseAnalytics.h' file not found
and
Could not build Objective-C module 'Firebase'
I'm on Sierra 10.12.6
None of these has worked so far to get rid of them. Does anyone know of any other possible solutions?
Here is the pod file info.
Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'MP' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MP
pod 'Firebase'
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
end
------ UPDATE ------
as Hexfire suggested below. I removed pods and manually added the frameworks.
After some fiddling with the pathing for my MP.h file, that first error is gone, however now I am getting these compiler errors now...
:0: error: PCH file '/Users/.../Library/Developer/Xcode/DerivedData/MP-gwnwsbrisiyspxepcxkbrojwtfrs/Build/Intermediates.noindex/PrecompiledHeaders/MP-swift_ZJX6RAPYV1IT-clang_2SW1CJQDTFSBO.pch' not found: module file not found
clang importer creation failed
I built a .pch file 'MP.pch' and I pointed to it in the Build Settings Prefix Header with $(SRCROOT) with no luck. Do I have to put all of my Framework paths in there as well?
All of this seems related to the search paths. Does anyone have any other thoughts here? Perhaps an example of the build settings syntax? For example $(SRCROOT) with quotes or without? $(SRCROOT)/MP.pch or just $(SRCROOT)?
One of the good ways to make this work is by not using CocoaPods. You can grab all necessary Firebase libraries from here and use within your app (if link doesn't work, go here, and scroll down to "Integrate without CocoaPods").
After downloading:
Unzip and see the README file for which Frameworks to include in to your project.
Add the ObjC linker flag in your Other Linker Settings in your target's build settings.
This is a valid option and 100% workable.
P.S. If Firebase is the only pod you are using, you can quickly and safely clean your project from any CocoaPods trails by using pod deintegrate command.
Good luck!
If All Of this do not work Try this for once
run sudo gem install cocoapods
You can check your version by typing pod --version anywhere on your terminal.
Make sure you are using latest Version of it

CocoaPods Error When Adding New Libraries

I am making a chat application and before I started, I installed the google Firebase frameworks through cocoapods. I now realise that I would like to use another framework to handle image caching.
However, when I add the new line to the podfile and run pod install, I get an error.
Here is my podfile
And here is the error:
I think your add incomplete name of pod, Please correct it like this.
pod 'Kingfisher', '~> 3.0'
And then install pod againg
pod install
You are just missing an ' at the end of 3.0
Change the line to:
pod 'Kingfisher', '~> 3.0'
Then, try again and you should be good to go.

Cocoapods pod file install not working "Unable to find a specification for `RealmSwift (~> 0.97)`" swift

I'm attempting to install Realm for swift, expect terminal keeps giving me this error: Unable to find a specification for RealmSwift (~> 0.97). My pod file has been laid out exactly as they recommend. This is my pod file:
target 'AppName' do
use_frameworks!
pod 'RealmSwift', '~> 0.97'
end
target 'AppName Tests' do
use_frameworks!
pod 'RealmSwift', '~> 0.97'
end
target 'AppName UITests' do
end
target 'AppName Keyboatd' do
end
target 'AppName Keyboard' do
end
I just tried it with Realm Objective-C and it worked fine for me. That's strange.
It's possible that since the version is actually called '0.97.0', maybe it's necessary to include that extra '.0'.
Alternatively, is it completely necessary to include the version specifier in there? You can just leave it off, and you'll still get the latest version of Realm (0.97.1 was released a few days ago!)