Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not build module 'Mapbox' (MGLAccountManager.h file not found) #270

Closed
munkius opened this issue Feb 9, 2016 · 26 comments
Closed

Comments

@munkius
Copy link

munkius commented Feb 9, 2016

I followed the steps in the installation guide file, but I get the error the Mapbox framework could not be found. It get this after adding libRCTMapboxGL.a to the section Link Binaries With Libraries. Before doing this I can successfully build my project.

I'm working with react-native-mapbox-gl version 3.2.1.

image

@JonnyBGod
Copy link

Same Error

@bsudekum
Copy link

Could you verify:

  1. Mapbox.framework is listed in Embedded Binaries
  2. Linked frameworks and Libraries has libRCTMapboxGL.a

Uploading a screenshot just like this would help

@ferndopolis
Copy link

Same error on 3.2.1. When I search for MGLAccountManaer.h in my project root

$ find . -type f -name "MGLAccountManager.h"                                                             
 ./node_modules/react-native-mapbox-gl/ios/Mapbox.framework/Mapbox.framework/Headers/MGLAccountManager.h

there is a Mapbox.framework nested inside Mapbox.framework. Is that right?

@munkius
Copy link
Author

munkius commented Feb 11, 2016

image

@bsudekum
Copy link

Hmmm that looks like. @ferndopolis something is up with your install process, when I run

find . -type f -name "MGLAccountManager.h"  
./node_modules/react-native-mapbox-gl/ios/Mapbox.framework/Headers/MGLAccountManager.h

Unsure how it would put the framework inside of the framework...

@munkius are you upgrading from a previous version?

@munkius
Copy link
Author

munkius commented Feb 11, 2016

@bsudekum It's a clean install, what makes you think that?

@bsudekum
Copy link

@munkius just wondering. An older version could have been messing with the build.

@munkius
Copy link
Author

munkius commented Feb 11, 2016

Tried it a bunch of times with a fres workspace to be sure not to disturb you guys with a nonsense issue :) Hope this can work out, I'm really curious about getting Mapbox to work within react native.

@bsudekum
Copy link

@munkius Here is a barebones setup: https://cloudup.com/c9J25rX9Jla

Can you download it, unzip it and try and run it? Maybe see if anything is different.

@munkius
Copy link
Author

munkius commented Feb 11, 2016

That builds just fine :) Plus, when I copy the node_modules/react-native-mapbox-gl folder towards my test project (after removing the previous version), that project builds successfully as well.

@jordangarside
Copy link

Getting the same issue in my project.
RN 0.19
MapboxGL 3.21

@jordangarside
Copy link

Got it to work, did react-native upgrade to reset the project.
Then I made sure to copy files if necessary for both the .xcode import and the .framework import.
I also had to make sure to set target to iOS version 9 instead of 7 which was the default for the RN project (MapboxGL seems to target 8).
Might want to make that more clear in the instructions.

Thanks!

@aksonov
Copy link
Contributor

aksonov commented Feb 16, 2016

I have the same issue. It is very weird, i see react-native-mapbox-gl/ios/Mapbox.framework without MGLAccountManager.h and react-native-mapbox-gl/ios/Mapbox.framework/Mapbox.framework with that file...

@samuelngs
Copy link

same issue here. It was working last week and it suddently breaks after I reinstall npm packages with npm install

@bsudekum
Copy link

@samuelngs @aksonov the install process changed in 3.2.0. Have you gone through the new install process?

@aksonov
Copy link
Contributor

aksonov commented Feb 16, 2016

@bsudekum I did all these steps several times without success.

@aksonov
Copy link
Contributor

aksonov commented Feb 16, 2016

setting target to 8.0 or 9.0 also didn't solve the problem. Why there are nested Mapbox.framework files?

@bsudekum
Copy link

@aksonov I'm not seeing nested frameworks when doing a fresh install. Here is what my completed install process looks like: https://cloudup.com/c9J25rX9Jla

@samuelngs
Copy link

@bsudekum I upgraded the mapboxgl to v3.2.0 last week and it worked fine before, yeah and I had gone through the new install process (the one with mapbox.framework).

@jordangarside
Copy link

I second @munkius and the copying of the react-native-mapbox-gl folder from @bsudekum worked for me
Edit: See the next posts before trying this, left for reference.

@bsudekum
Copy link

I'm confused as to how these folders would look any different.

@jordangarside
Copy link

@bsudekum
So it turns out that wasn't my problem, the problem is that 3.2.3 isn't working for me now (same issue as this one).
I tried to get 3.2.3 to work quite a few times on my project and also by starting a new one (with react-native init) and neither worked.
Switching to the 3.2.2 package worked as expected (that's the one you have in the working example).

It's really important that anyone doing this selects Copy files if necessary on both the .xcode import and the .framework import. That used to be in the old instructions.

Still not sure how to get 3.2.3 to work, but I give up for now.

@aksonov
Copy link
Contributor

aksonov commented Feb 17, 2016

@bsudekum It uses 3.2.2, not 3.2.3. After i've removed node_modules and run npm install, i've got exactly the same issue....

@jarredwitt
Copy link

I was running into this issue as well.

Mapbox 3.2.3
RN 0.19
Node 5.3.0
NPM 3.3.12

I was seeing the same issue as the others with Mapbox.framework containing a Mapbox.framework. I was able to solve the issue and get it to build by moving the nested Mapbox.framework to another location and then deleting the Mapbox.framework that was left. I then moved the nested Mapbox.framework back into the ios directory within my node_modules/react-native-mapbox-gl and the build was able to succeed. Hope this helps. Let me know I need to clarify anything else.

@vinhtq
Copy link

vinhtq commented Feb 18, 2016

I also get this problem! Did anybody solve that?

@bsudekum
Copy link

This has now been fixed and released in react-native-mapbox-gl@v4.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants