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

Linker command failed with exit code 1 (use -v to see invocation) #297

Closed
edward-at-intelex opened this Issue Mar 3, 2016 · 12 comments

Comments

Projects
None yet
@edward-at-intelex

edward-at-intelex commented Mar 3, 2016

Hello - I searched the issues here as well as in stackOverflow, but cannot seem to find a resolution to this problem.

I followed the manual instructions - https://github.com/mapbox/react-native-mapbox-gl/blob/master/ios/install.md - to install react-native-mapbox-gl for iOS, installing manually onto my Macbook Pro and I am using_ xCode 7.2.x_ .

I am getting an error in xCode and the project fails to build with the following error :

ld: framework not found Mapbox
clang: error: linker command failed with exit code 1 (use -v to see invocation)

xCode is executing the following command:

Ld /Users/edward/Library/Developer/Xcode/DerivedData/rnp3-bmfxgzpqxxodcqfrgjyuxbsnajtz/Build/Products/Debug-iphonesimulator/rnp3.app/rnp3 normal i386

    cd /Users/edward/gitRepo/someProject/ios

    export IPHONEOS_DEPLOYMENT_TARGET=8.0

    export PATH="(extremely long path statement)"

-v

general details -
*running react-native 0.2x (latest)
*used node 4.x stable to install react-native-mapbox-gl via npm
*Also changed the deployment target from iOS 7.x to 8.x and 9.x in xCode and still get the same results.

initial thought - do I have to add some file or folder to path? let me know.

Any help is appreciated. thanks - Edward

@bsudekum

This comment has been minimized.

Show comment
Hide comment
@bsudekum

bsudekum Mar 6, 2016

Any chance you could post a screenshot of your Xcode setup? Can you verify you added the Mapbox framework in the embedded framework section?

bsudekum commented Mar 6, 2016

Any chance you could post a screenshot of your Xcode setup? Can you verify you added the Mapbox framework in the embedded framework section?

@edward-at-intelex

This comment has been minimized.

Show comment
Hide comment
@edward-at-intelex

edward-at-intelex Mar 7, 2016

@bsudekum thanks for responding. I will post a screenshot of xCode setup in a moment but yes I embedded the Mapbox framework in the embedded framework settings under the General Tab for my project.

In the meantime, I thought I would follow up with the following:

  1. looks like the process for creating Android version works (I was able to implement the example)
  2. I also attempted the cocoapods install. Got a similar linker error -

ld: library not found for -lPods-{projectName} clang: error: linker command failed with exit code 1 (use -v to see invocation)

(even going further as to add the additional references to my podfile as you described further on in the iOS instructions and updating the node_modules references appropriately, this executed with no errors)
`
source 'https://github.com/CocoaPods/Specs.git'

xcodeproj 'projectName'
workspace 'projectName'

pod 'RCTMapboxGL', :path => '../node_modules/react-native-mapbox-gl/ios'
pod 'React', :path => '../node_modules/react-native'
pod 'React/RCTGeolocation', :path => '../node_modules/react-native'
pod 'React/RCTImage', :path => '../node_modules/react-native'
pod 'React/RCTNetwork', :path => '../node_modules/react-native'
pod 'React/RCTText', :path => '../node_modules/react-native'
pod 'React/RCTWebSocket', :path => '../node_modules/react-native'
`

So having tried both methods on two mac machines I am currently stuck.

edward-at-intelex commented Mar 7, 2016

@bsudekum thanks for responding. I will post a screenshot of xCode setup in a moment but yes I embedded the Mapbox framework in the embedded framework settings under the General Tab for my project.

In the meantime, I thought I would follow up with the following:

  1. looks like the process for creating Android version works (I was able to implement the example)
  2. I also attempted the cocoapods install. Got a similar linker error -

ld: library not found for -lPods-{projectName} clang: error: linker command failed with exit code 1 (use -v to see invocation)

(even going further as to add the additional references to my podfile as you described further on in the iOS instructions and updating the node_modules references appropriately, this executed with no errors)
`
source 'https://github.com/CocoaPods/Specs.git'

xcodeproj 'projectName'
workspace 'projectName'

pod 'RCTMapboxGL', :path => '../node_modules/react-native-mapbox-gl/ios'
pod 'React', :path => '../node_modules/react-native'
pod 'React/RCTGeolocation', :path => '../node_modules/react-native'
pod 'React/RCTImage', :path => '../node_modules/react-native'
pod 'React/RCTNetwork', :path => '../node_modules/react-native'
pod 'React/RCTText', :path => '../node_modules/react-native'
pod 'React/RCTWebSocket', :path => '../node_modules/react-native'
`

So having tried both methods on two mac machines I am currently stuck.

@edward-at-intelex

This comment has been minimized.

Show comment
Hide comment
@edward-at-intelex

edward-at-intelex Mar 7, 2016

Here is the general order of steps I performed in image form as per your request @bsudekum

  1. install at command prompt
    mb001_install
  2. add to project
    mb002_setup
  3. embed in general tab
    mb003_embedbinary_ingeneral
  4. add run script in build phase
    mb004_addbashscript
  5. add framework/library
    mb005_addlibrctmapbox
  6. result of adding framework/library
    mb006_addlinkbinary

I then implemented the example and built the project in Xcode.

edward-at-intelex commented Mar 7, 2016

Here is the general order of steps I performed in image form as per your request @bsudekum

  1. install at command prompt
    mb001_install
  2. add to project
    mb002_setup
  3. embed in general tab
    mb003_embedbinary_ingeneral
  4. add run script in build phase
    mb004_addbashscript
  5. add framework/library
    mb005_addlibrctmapbox
  6. result of adding framework/library
    mb006_addlinkbinary

I then implemented the example and built the project in Xcode.

@edward-at-intelex

This comment has been minimized.

Show comment
Hide comment
@edward-at-intelex

edward-at-intelex Mar 7, 2016

Here was the result (from one of a number of multiple tests) @bsudekum ...

screen shot 2016-03-07 at 3 51 56 pm

specs:
*xCode 7.2.1
*simulator was set up as iphone5 / iOS 8.1,9.1,9.2 or iPhone 6s iOS 8.1,9.1,9.2
*fresh install for examples: npm / nvm, node 4.x, react-native 0.20 (they have since upgraded to 0.21)
*I am the admin of my machine with root access (if required)

I also ran the setup against cocoa pods (latest version) and had the native version of Ruby for OSX (I think 2.x) then upgraded to the latest version for OSX.

_notes: in a test I performed today (March 7th, over a week later) I was able to get the example iOS app running by launching the site from the _terminal* using the commandreact-native run-ios !!! but not in xCode on two different machines??
** I also noted that the manual instructions for iOS do not necessarily match the images provided , had to infer whether to add "bash" to the run script command for example, or when you right-click on your project to add files, do you add the RCTMapbox.xpcodeproj to the root of your project or in the libraries folder? - The choice you make determines whether xCode finds Mapbox.framework easily or not when you embed it in the general tab and it may be the cause of some issues (xCode might not find it on building the project and the icon indicates its 'missing')

mb007_gotittoworkatcommandprompt

edward-at-intelex commented Mar 7, 2016

Here was the result (from one of a number of multiple tests) @bsudekum ...

screen shot 2016-03-07 at 3 51 56 pm

specs:
*xCode 7.2.1
*simulator was set up as iphone5 / iOS 8.1,9.1,9.2 or iPhone 6s iOS 8.1,9.1,9.2
*fresh install for examples: npm / nvm, node 4.x, react-native 0.20 (they have since upgraded to 0.21)
*I am the admin of my machine with root access (if required)

I also ran the setup against cocoa pods (latest version) and had the native version of Ruby for OSX (I think 2.x) then upgraded to the latest version for OSX.

_notes: in a test I performed today (March 7th, over a week later) I was able to get the example iOS app running by launching the site from the _terminal* using the commandreact-native run-ios !!! but not in xCode on two different machines??
** I also noted that the manual instructions for iOS do not necessarily match the images provided , had to infer whether to add "bash" to the run script command for example, or when you right-click on your project to add files, do you add the RCTMapbox.xpcodeproj to the root of your project or in the libraries folder? - The choice you make determines whether xCode finds Mapbox.framework easily or not when you embed it in the general tab and it may be the cause of some issues (xCode might not find it on building the project and the icon indicates its 'missing')

mb007_gotittoworkatcommandprompt

@frankbolviken

This comment has been minimized.

Show comment
Hide comment
@frankbolviken

frankbolviken Mar 13, 2016

I'm getting the same issue. Been following the guide for adding to Xcode manually, but getting the
framework not found Mapbox when trying to build the application.

frankbolviken commented Mar 13, 2016

I'm getting the same issue. Been following the guide for adding to Xcode manually, but getting the
framework not found Mapbox when trying to build the application.

@frankbolviken

This comment has been minimized.

Show comment
Hide comment
@frankbolviken

frankbolviken Mar 15, 2016

My problem was that I initially did one of the steps wrong (added a library to the wrong path), and no matter if I fixed it it was broken.
Had to recreate the whole project, then it worked fine.

frankbolviken commented Mar 15, 2016

My problem was that I initially did one of the steps wrong (added a library to the wrong path), and no matter if I fixed it it was broken.
Had to recreate the whole project, then it worked fine.

@edward-at-intelex

This comment has been minimized.

Show comment
Hide comment
@edward-at-intelex

edward-at-intelex Mar 21, 2016

@frankbolviken so even just removing and re-adding the correct library and its path did not work for you? re-creating the entire project? strange, I will try.

edward-at-intelex commented Mar 21, 2016

@frankbolviken so even just removing and re-adding the correct library and its path did not work for you? re-creating the entire project? strange, I will try.

@tharrington

This comment has been minimized.

Show comment
Hide comment
@tharrington

tharrington Apr 13, 2016

@edward-at-intelex did you solve this problem?

tharrington commented Apr 13, 2016

@edward-at-intelex did you solve this problem?

@digitaldavenyc

This comment has been minimized.

Show comment
Hide comment
@digitaldavenyc

digitaldavenyc Aug 15, 2016

I am experiencing the same issue. I have followed the guide exactly but still receive the error

ld: framework not found Mapbox
clang: error: linker command failed with exit code 1 (use -v to see invocation)

digitaldavenyc commented Aug 15, 2016

I am experiencing the same issue. I have followed the guide exactly but still receive the error

ld: framework not found Mapbox
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@dmiskiew

This comment has been minimized.

Show comment
Hide comment
@dmiskiew

dmiskiew Sep 16, 2016

I added following entry to Build Settings -> Framework Search Paths (Debug and Release) and it solved the problem on my machine:
$(PROJECT_DIR)/../node_modules/react-native-mapbox-gl (recursive)

screenshotmapbox

dmiskiew commented Sep 16, 2016

I added following entry to Build Settings -> Framework Search Paths (Debug and Release) and it solved the problem on my machine:
$(PROJECT_DIR)/../node_modules/react-native-mapbox-gl (recursive)

screenshotmapbox

@tmcw tmcw added this to the v5.1.0 - Installation Robustness milestone Sep 30, 2016

@nitaliano nitaliano closed this Sep 6, 2017

@michaelstokes

This comment has been minimized.

Show comment
Hide comment
@michaelstokes

michaelstokes Dec 11, 2017

Any update on this, I seem to be getting the same error framework not found Mapbox

Most recent post #741

Seem to have tried many approaches, both via CocoaPods and Manual installation ... neither is currently working for me.

When doing CocoaPods, I get framework not found Mapbox, when doing manual install I get issues such as framework not found XCTest

After removing the project, cloning again, running npm install, and jscodeshift -t react-codemod/transforms/React-PropTypes-to-prop-types.js clustr_app/node_modules/ on my project node modules, I then get the following after the app starts up which is libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Thanks very much

michaelstokes commented Dec 11, 2017

Any update on this, I seem to be getting the same error framework not found Mapbox

Most recent post #741

Seem to have tried many approaches, both via CocoaPods and Manual installation ... neither is currently working for me.

When doing CocoaPods, I get framework not found Mapbox, when doing manual install I get issues such as framework not found XCTest

After removing the project, cloning again, running npm install, and jscodeshift -t react-codemod/transforms/React-PropTypes-to-prop-types.js clustr_app/node_modules/ on my project node modules, I then get the following after the app starts up which is libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Thanks very much

@cglacet

This comment has been minimized.

Show comment
Hide comment
@cglacet

cglacet Jun 28, 2018

I have the same problem, my installation used to work, then I followed this procedure to add facebook login support and I think it broke something but I don't know what.

cglacet commented Jun 28, 2018

I have the same problem, my installation used to work, then I followed this procedure to add facebook login support and I think it broke something but I don't know what.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment