3

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!

Jan L
  • 233
  • 1
  • 10
  • 1
    What is the deployment target of your app set to? The last line of the error suggests that it isn't high enough. – jnpdx Jul 26 '21 at 15:44
  • @jnpdx It says it automatically selected ios 13.5, did you mean that? – Jan L Jul 26 '21 at 15:46
  • @jnpdx I just tried setting it to the newest ios version (14.6) but it didn't change the error. Any other ideas? – Jan L Jul 26 '21 at 15:57
  • 1
    Indeed, a version issue. From Mapbox-iOS-SDK podspec (https://github.com/CocoaPods/Specs/blob/master/Specs/a/5/9/Mapbox-iOS-SDK/6.3.0/Mapbox-iOS-SDK.podspec.json) we see it needs `MapboxMobileEvents` on version `"~> 0.10.4"`. While `MapboxSearchUI` awaits for a higher version. Maybe there is a version of `MapboxSearchUI` which accepts a 0.10.4 like the other one... Else, ask for an update on their repo? – Larme Jul 26 '21 at 16:06
  • @Larme I have contacted their Support about this and will update for anyone having the same issue. I can't seem to find a list of versions I could try out so there is no other way I guess – Jan L Jul 26 '21 at 16:23

2 Answers2

2

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.

Jan L
  • 233
  • 1
  • 10
  • Did you have any trouble importing `MaboxSearch` or `MapboxSearchUI` afterwards? I'm getting a faild build module error. – Ramen Ninja Sep 09 '21 at 10:22
  • No I don't get any issues with that. Sorry for the late response. – Jan L Oct 13 '21 at 11:53
  • Hi, the solution doesn't work because there is a crash that occurs while typing in the search field with this pod "'MapboxSearchUI', ">= 1.0.0-beta", "<2.0" version. The solution to this crash is to install the beta.1 version but sadly till now it doesn't get installed. Any other solution to install pod 'MapboxSearchUI', ">= 1.0.0-beta.1", "<2.0" ??? – Md Rais Nov 18 '21 at 15:51
0

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'
Curiosity
  • 1,753
  • 3
  • 25
  • 46