Mapbox-gl-native: Getting Issue while running "make ipackage" command

Created on 21 Dec 2017  Â·  9Comments  Â·  Source: mapbox/mapbox-gl-native

❌ /Users/sameera/mapbox-gl-native/platform/darwin/src/MGLVectorSource+MGLAdditions.h:5:12: definition of 'MGLVectorSource' must be imported from module 'Mapbox.MGLVectorSource' before it is required

@interface MGLVectorSource (MGLAdditions)

bug build iOS

All 9 comments

It appears that this is related to modifications you may have made and therefore is not an issue we can offer much help with. If that is not the case, please provide more information as to when you’re encountering this issue and precisely how to reproduce it.

we are using RSA Encryption (Objective C) class along with singleton class for passing token Strings to http_file_source.mm where the actual tiles encryption is happening .
So what should be the best practice to achieve the same?

I have the same issue. Actually 2 errors:

definition of 'MGLPolyline' must be imported from module 'Mapbox.MGLPolyline' before it is required
...
definition of 'MGLVectorSource' must be imported from module 'Mapbox.MGLVectorSource' before it is required

Steps:

git clone --recursive -j8 https://github.com/mapbox/mapbox-gl-native.git
cd mapbox-gl-native/
make ipackage

Repo is clean, no changes.
Can it be due to the use of xcode 8.2.1 (I have rather old Mac as a build env)?

Starting of the log:

FORMAT= BUILD_DEVICE= SYMBOLS= \
./platform/ios/scripts/package.sh

  • Configuring dynamic and static Debug framework for iphoneos 10.2; symbols: YES
    Xcode 8.2.1
    Build version 8C1002
  • Recording library version…
    mapbox-gl-native 28a21f3b0b
  • Building targets (build 11805, version 3.7.0-beta.4)
  • Building for iOS Simulator using scheme dynamic+static

and if I clone repo tag 5.0.2, then only 1 error in a log:

definition of 'MGLVectorSource' must be imported from module 'Mapbox.MGLVectorSource' before it is required

I am having same issues here. I am on Xcode 9.1(9B55)

The dynamic build works fine on the command "make iframework BUILDTYPE=Release". It seems to be only failing on static build? If I read the documentation correctly, the "make ipackage" builds both the dynamic and static frameworks.

Reproducing Steps:
1) git clone https://github.com/mapbox/mapbox-gl-native.git
2) cd mapbox-gl-native
3) make ipackage

The first couple of lines are similar to what @sheburdos posted, but here are my output:
FORMAT= BUILD_DEVICE= SYMBOLS= \
./platform/ios/scripts/package.sh

  • Configuring dynamic and static Debug framework for iphoneos 11.1; symbols: YES
    Xcode 9.1
    Build version 9B55
  • Recording library version…
    mapbox-gl-native 65203dca77
  • Building targets (build 11809, version 3.7.0-beta.4)
  • Building for iOS Simulator using scheme dynamic+static

Side notes: Tag v5.0.2 does not build for me on either the dynamic or static framework. Error: unknown warning group '-Wmaybe-uninitialized', ignored [-Werror,-Wunknown-warning-option]

  • Mapbox iOS SDK v3.7.x+ requires Xcode 9.x to build. There was a bit of a lag in updating the build docs (sorry) — see https://github.com/mapbox/mapbox-gl-native/pull/10795 for changes.
  • See this page for a list of recent tagged releases. If you’re building for iOS, I’d suggest using the most recent tag prefixed with ios-.
  • @afxwin You’re correct: make iframework only builds the dynamic framework, which is generally what we recommend developers integrate into their apps. The make ipackage command is meant for when Mapbox packages/publishes releases, so it builds all flavors (dynamic and static).

I was able to reproduce the module import errors when building the static framework with Xcode 9.2 on master, as of 814c87fbab4608662f90084cff64c27cc5b12bc2.

Workaround: build from tag ios-v3.7.2. The master branch is our unstable development branch and can contain issues/bugs. If you’re forking our SDK, base your build on a stable release tag/branch.

Building from tag ios-v3.7.2 passed for me with Xcode 9.1

Thanks to everyone for reporting this issue — it’s fixed by #10820.

Was this page helpful?
0 / 5 - 0 ratings