Closed chaipipatP closed 5 years ago
@chaipipatP same issue here,Have you solved the problem?
I solved this problem. Follow the steps below:
yarn add @mapbox/react-native-mapbox-gl
react-native link
If this step is finished, running react-native run-ios
directly will report undel this error.found` this error. The official documentation does not give the corresponding detailed steps.
react-native-mapbox-gl/example/node_modules/@mapbox/react-native-mapbox-gl/ios/Mapbox.framework
add Link Binary with Libraries
Looks like this:
Then run react-native run-ios
will not report an error again. But running the program will crash.
Reason: image not found
finally, Looks like this:
Then run react-native run-ios
will not report an error again.
@giantss Shouldn't be pod install
be enough to have this included?
Anyway, I'm facing a strange issue. On a fresh installed machine, this does not happen using XCode 10, on another machine with the SAME code this produces the mentioned error above :( is there anything to solve this issue? (like some hidden lock-file which I need to remove, as the native mapbox SDK seems to be downloaded somewhere ...)
@FibreFoX I started to think the same as you, but it was not as perfect as I thought.
I have not upgraded to xcode 10
, I am using xcode 9.4
.
I have not encountered such a problem. Sorry.
@giantss no worries :) just wanted to state that the provided solution via "configuration via clicking" is against the idea of using that Podfile
(at least IMHO).
If it helps, we are using RN 0.57.4 and @mapbox/react-native-mapbox-gl
in version 6.1.3
.
@FibreFoX I upgraded my environment today and encountered the same problem as you. #1424
I'm seeing this issue just today on App Center. Going to try @giantss linking procedures though I thought I had it all done correctly.
I'm getting the same error, but just on CircleCi. Locally (from Xcode or Fastlane) it works fine, but when it builds with CircleCi+Fastlane, on both Xcode 9.3 and 10.1.0, id doesn't work out.
Manual installation or via podfile, the same error happens:
▸ /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;
Any idea of what can be done on Fastlane or CircleCi to make it works?
Update:
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 that was not clear: when I look into ios folder I don't see Mapxbox.framework
. Then I saw that Mapxbox.framework
is installed from an npm
preinstall
hook. So taking a look in the logs I figured out that this was not being called somehow from CircleCi.
(I don't know yet why this npm hook works fine locally, but doesn't work for CircleCi - maybe it's a Lerna issue).
A not ideal solution that I found for it: 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
).
Are you using pods?
We got this tracked in a duplicate issue and a PR open to use pods. Expect this to become easier very soon.
@kristfal that's great to hear – can you link to the duplicate issue?
I was experiencing this issue as well, and was surprised CocoaPods wasn't handling this. Turns out I was on CocoaPods 1.5.0; upgrading to 1.6.1 solved the issue for me.
I just spent a couple of hours struggling with pretty much the same issue using @react-native-mapbox-gl/maps
(and RN 0.61). Here are some brief notes, in case it helps anyone else in a similar situation. It's mostly the same as what estevaolucas said above but with a little bit of extra context.
npm run fetch:ios:sdk
preinstall hook calls another script scripts/download-mapbox-gl-native-ios-if-on-mac.js
npm explore @react-native-mapbox-gl/maps -- npm run fetch:ios:sdk
in the job running on a Mac
Install With CocoaPods
Podfile
Error
react-native-cli: 2.0.1 react-native: 0.51.0