nativescript-checkbox icon indicating copy to clipboard operation
nativescript-checkbox copied to clipboard

"linker command failed with exit code 1" when building from XCode

Open monkeymonk opened this issue 6 years ago • 10 comments

This error appears when building from XCode:

ld: warning: directory not found for option '-F/Users/lambda/Library/Developer/Xcode/DerivedData/dist-aicmjkgjwnnaczajminirkrtrqmo/Build/Products/Debug-iphoneos/BEMCheckBox'
ld: framework not found BEMCheckBox
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I use nativescript-cli and nativescript-vue. When I run tns plugin add nativescript-checkbox it returns Plugin "nativescript-checkbox" is already installed..

Podfile look like this:

use_frameworks!

target "dist" do
# Begin Podfile - /...path to project.../dist/node_modules/nativescript-checkbox/platforms/ios/Podfile 
 pod 'BEMCheckBox', '~> 1.4.1'
 
 # End Podfile 

end

I really don't know how to make it work. Any help will be much appreciated! :-)

monkeymonk avatar Sep 17 '18 08:09 monkeymonk

Have you tried removing the platforms/ios folder after adding the plugin? That will force a rebuild of the native project upon the next tns run ios. Then look for any Pod-related errors in the log in case the problem persists.

EddyVerbruggen avatar Sep 17 '18 09:09 EddyVerbruggen

Hello @EddyVerbruggen,

I have tried to run npm run clean && npm run build:ios but not luck. I've succeeded using cd dist && tns prepare ios --release.

I guess then that the issue is more related to nativescript-cli, nativescript-vue or nativescript itself.

This issue is solved for me. :-)

monkeymonk avatar Sep 17 '18 15:09 monkeymonk

@monkeymonk you may want to upgrade to the latest cli-template. The project structure is significantly simpler, and should generally work a lot better with different plugins. We've added an upgrade guide to the docs, and in most cases it shouldn't take more than 10-20 minutes. https://nativescript-vue.org/en/docs/getting-started/upgrade-guide/

rigor789 avatar Sep 17 '18 15:09 rigor789

Thank you @rigor789, I will consider this. It seems cleaner but I can't find where the main.js path is setup (need to update that path). Any clue ? :-)

monkeymonk avatar Sep 21 '18 09:09 monkeymonk

I'm not sure what you are looking for, please hop on the nativescript community slack - it's faster and easier to figure things out there! https://developer.telerik.com/wp-login.php?action=slack-invitation

rigor789 avatar Sep 21 '18 23:09 rigor789

I have the very same error (without using nativescript-vue). The application is compiled from command line, but the compilation fails from Xcode. As told, I've removed the /platforms first and made a fresh build. Cf : capture d ecran 2019-01-28 a 13 53 33

on-meetsys avatar Jan 28 '19 12:01 on-meetsys

Does anyone find the solution ?

toams69 avatar Jun 16 '20 20:06 toams69

tns platform clean ios
tns prepare ios

solved the problem for me. I opened the workspace again after running above 2 commands. Then let it index and run Product > Archive. It worked

Whip avatar Jun 24 '20 11:06 Whip

Here's what worked for me. After running tns prepare ios and tns build ios --release, it will create Xcode files in your_project/platforms/ios. Make sure you open the your_project.xcworkspace and NOT the your_project.xcodeproj. Then you can build or archive your app without the error ld: framework not found BEMCheckBox

flipperlite avatar Jun 24 '20 15:06 flipperlite

@flipperlite Solved the problem. Thanks!

rkJun avatar Jul 21 '20 04:07 rkJun