0

I've been trying to fix an issue happening on CicleCi when I try to integrate @mapbox/react-native-mapbox-gl on my project.

Locally MapBox works builds and works fine. But only on CircleCi, the build doesn't work.

▸ /Users/distiller/project/packages/my-project/node_modules/@mapbox/react-native-mapbox-gl/ios/RCTMGL/RCTMGLCallout.h:11:9: fatal error: module 'Mapbox' not found
▸ @import Mapbox;

The error happens on both Xcode 9.3 and 10.1.0. And I had tried via both manual and Cocoapods setup.

Estevão Lucas
  • 4,440
  • 34
  • 37

1 Answers1

0

After almost 20 different trial and error, and all related to module/framework resolving on Xcode - following basically StackOverflow posts like this, I realized something: https://github.com/mapbox/react-native-mapbox-gl/tree/master/ios

What happens is: Mapxbox.framework is installed from a npm preinstall hook. So I figured out that this was not being called somehow from CircleCi only. I don't know yet if it's a lerna or a CicleCi issue.

A not ideal solution that I found for it was: call mapbox's script to download the framework manually before the ios build (npm explore @mapbox/react-native-mapbox-gl -- npm run fetch:ios:sdk).

Estevão Lucas
  • 4,440
  • 34
  • 37
  • This should be solved in 7.2.0+ as @react-native-mapbox-gl/maps now uses cocapods, no npm presinstall hook – mfazekas Mar 22 '20 at 18:55