Maps: Upgrade iOS SDK to 6.0.0

Created on 10 Aug 2020  路  11Comments  路  Source: react-native-mapbox-gl/maps

It looks like there is a new version of the underlying iOS mapbox SDK, I'm getting the following in logs (v8.1.0-rc.2)

Mapbox Maps SDK for iOS version 6.0.0 is now available: https://github.com/mapbox/mapbox-gl-native-ios/releases/tag/ios-v6.0.0

iOS

Most helpful comment

hey @nasmuris, great that it worked 馃憤

Could you concisely write down in one comment the exact steps required to upgrade, so others can see them at a glance till we increase/ include it in the repo.

Thanks 馃檱

All 11 comments

would it be possible to try the new SDK via setting ENV["REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION"]?
running REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION="~> 6.0" pod update
results in

[!] CocoaPods could not find compatible versions for pod "@react-native-mapbox-gl-mapbox-static":
  In Podfile:
    react-native-mapbox-gl (from `../node_modules/@react-native-mapbox-gl/maps`) was resolved to 8.1.0-rc.2, which depends on
      @react-native-mapbox-gl-mapbox-static (~> 6.0)

None of your spec sources contain a spec satisfying the dependency: `@react-native-mapbox-gl-mapbox-static (~> 6.0)`.

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION="~> 6.0" pod install --repo-update
leads to

[!] CocoaPods could not find compatible versions for pod "@react-native-mapbox-gl-mapbox-static":
  In snapshot (Podfile.lock):
    @react-native-mapbox-gl-mapbox-static (= 5.8.0, ~> 5.8)

  In Podfile:
    react-native-mapbox-gl (from `../node_modules/@react-native-mapbox-gl/maps`) was resolved to 8.1.0-rc.2, which depends on
      @react-native-mapbox-gl-mapbox-static (~> 6.0)

Specs satisfying the `@react-native-mapbox-gl-mapbox-static (= 5.8.0, ~> 5.8), @react-native-mapbox-gl-mapbox-static (~> 6.0)` dependency were found, but they required a higher minimum deployment target.

I've managed to install the version 6.2.0-beta.1 using ENV['REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION'] = '~> 6.2.0-beta.1' in combination with local podspec pod '@react-native-mapbox-gl-mapbox-static', :path => './@react-native-mapbox-gl-mapbox-static.podspec.json'
I had to provide .netrc file according to documentation
I also downloaded the direct zip file mapbox-ios-sdk-6.2.0-beta.1-dynamic-with-events and use it as a source in podspec but run into issue https://github.com/mapbox/mapbox-gl-native-ios/issues/196
here is my podspec, practically just C&P of @mfazekas' with change of the source

{
  "name": "@react-native-mapbox-gl-mapbox-static",
  "version": "6.2.0-beta.1",
  "summary": "Mapbox Mobile Events for static link with Mapbox GL",
  "description": "This is an unufficial workaround that allows consumption of Mapbox-iOS-SDK without use_frameworks!. Mapbox Mobile Events collects usage information to help Mapbox improve its products.",
  "homepage": "https://github.com/react-native-mapbox-gl/maps/wiki/react-native-mapbox-gl-mapbox-static-podspec",
  "license": {
    "type": "ISC",
    "file": "LICENSE.md"
  },
  "authors": {
    "react-native-mapbox-gl": "[email protected]"
  },
  "screenshots": "https://docs.mapbox.com/ios/api/maps/5.8.0/img/screenshot.png",
  "source": {
    "http": "file://mapbox-ios-sdk-6.2.0-beta.1-dynamic-with-events.zip",
    "flatten": true
  },
  "platforms": {
    "ios": "9.0"
  },
  "requires_arc": true,
  "vendored_frameworks": "dynamic/MapboxMobileEvents.framework",
  "module_name": "MapboxMobileEvents",
  "preserve_paths": "**/*.bcsymbolmap"
}

after updating pods, my Xcode project was updated with folowing (changes related to @react-native-mapbox-gl-mapbox-static) :

- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/MapboxMobileEvents.framework",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/MapboxMobileEvents.framework.dSYM",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/BADC3E19-B154-39DA-BE9A-E7C52B45BD0C.bcsymbolmap",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/F86F5A50-B0A0-3D96-8330-20AFDAC47DCC.bcsymbolmap",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/877E1F78-505A-34B9-A9A0-42F8BFA435B9.bcsymbolmap",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/7C38D00F-328F-3E0C-B30E-E47F366F0F3D.bcsymbolmap",
-  "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/MapboxMobileEvents.framework",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/MapboxMobileEvents.framework.dSYM",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/BADC3E19-B154-39DA-BE9A-E7C52B45BD0C.bcsymbolmap",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/F86F5A50-B0A0-3D96-8330-20AFDAC47DCC.bcsymbolmap",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/877E1F78-505A-34B9-A9A0-42F8BFA435B9.bcsymbolmap",
- "${PODS_ROOT}/@react-native-mapbox-gl-mapbox-static/dynamic/7C38D00F-328F-3E0C-B30E-E47F366F0F3D.bcsymbolmap",

@mfazekas as you created the former 5+ podspec, don't you have any idea what could have gone wrong?

Finally solved this, I'm adding MapboxMobileEvents directly to the project as stated in official installation docs but using Mapbox-iOS-SDK via Pods, so no adding Mapbox to Framworks...
furthermore, I'm having enviroment vars defined in my Podifle:

  ENV['REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION'] = '~> 6.2.0-beta.1'
  ENV['REACT_NATIVE_MAPBOX_GL_USE_FRAMEWORKS'] = 'true'

Seems to be working OK so far

hey @nasmuris, great that it worked 馃憤

Could you concisely write down in one comment the exact steps required to upgrade, so others can see them at a glance till we increase/ include it in the repo.

Thanks 馃檱

@nasmuris where do you find the mapbox-ios-sdk-6.2.0-beta.1-dynamic-with-events.zip?

@nasmuris

using ENV['REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION'] = '~> 6.2.0-beta.1'

maybe a noob question, but how did you set this ENV variable?

I have been trying to update to ^8.1.0-rc10 and get the same error as @nasmuris gets:

[!] CocoaPods could not find compatible versions for pod "@react-native-mapbox-gl-mapbox-static":
  In Podfile:
    react-native-mapbox-gl (from `../node_modules/@react-native-mapbox-gl/maps`) was resolved to 8.1.0-rc10, which depends on
      @react-native-mapbox-gl-mapbox-static (~> 5.9.0)

None of your spec sources contain a spec satisfying the dependency: `@react-native-mapbox-gl-mapbox-static (~> 5.9.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

I have tried to follow the instructions listed above but they did not work for me. Can you please help resolve this?

Also getting exactly the same issue as mentioned by @NathanNovak.

@NathanNovak I've got it working again now. While this fix feels like a temp workaround, it might at least keep you developing for the moment.

I altered the pod spec in the npm module - node_modules/@react-native-mapbox-gl/maps/react-native-mapbox-gl.podspec. On line 5 of the file there is the variable default_ios_mapbox_version. I changed this variable contents form '~> 5.9.0' to '~> 5.8.0'. Naturally there are references to the 5.9.0 version in your podfile.lock, so you will need to either delete your podfile.lock or update the references there too.

FWIW I've also published 5.9.0 of static fixer, so it rc10 should work if you default to the 5.9.0 version

Based on suggestion of @nasmuris above, I added these lines to Podfile and it worked now:

...
target 'MyAwesomeApp' do
  $ReactNativeMapboxGLIOSVersion = "~> 5.9.0"
  ENV['REACT_NATIVE_MAPBOX_GL_USE_FRAMEWORKS'] = 'true'
  ...
end
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivari picture ivari  路  3Comments

jayhaluska picture jayhaluska  路  5Comments

calypsow777 picture calypsow777  路  5Comments

MariaSyed picture MariaSyed  路  4Comments

SethArchambault picture SethArchambault  路  3Comments