xcodebuild -target -xcconfig doesn't work for react-native project - ios

When I am running the command xcodebuild -target targetName -xcconfig configName.xcconfig I have the following errors:
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/React/build/Release-iphoneos/libReact.a'
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/Libraries/ActionSheetIOS/build/Release-iphoneos/libRCTActionSheet.a'
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/Libraries/Geolocation/build/Release-iphoneos/libRCTGeolocation.a'
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/Libraries/Image/build/Release-iphoneos/libRCTImage.a'
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/Libraries/LinkingIOS/build/Release-iphoneos/libRCTLinking.a'
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/Libraries/Network/build/Release-iphoneos/libRCTNetwork.a'
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/Libraries/Settings/build/Release-iphoneos/libRCTSettings.a'
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/Libraries/Text/build/Release-iphoneos/libRCTText.a'
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/Libraries/Vibration/build/Release-iphoneos/libRCTVibration.a'
clang: error: no such file or directory: '/Users/azghibarta/Documents/WorkFolder/ReactNativeApps/eezam/node_modules/react-native/Libraries/WebSocket/build/Release-iphoneos/libRCTWebSocket.a'
When I am running the command xcodebuild -schema schemaName all is working fine.
Finally .. I need to change the config schema for the build (dev / prod etc) as Jenkins job, and that it's possible only with the first command that gives error. I know about Xcode Plugin for Jenkins, but I want to use my own build script.

Related

clang: error: no such file or directory: Command Ld failed with a nonzero exit code

clang: error: no such file or directory:
'/Users/xujun/Library/Developer/Xcode/DerivedData/SimplifiedR2-cqmftumxfrylwdgmkcovwahjhquk/Build/Products/Debug-iphonesimulator/libRDServices.a'
Command Ld failed with a nonzero exit code
Xcode 13.4.
My project won´t run after adding framework by Carthage. How to solve this error?

Mulitple 'clang: error: no such file or directory' after trying to build xcode project to phone

While trying to build my React Native project to test on my phone, I get multiple clang: error: no such file or directory for various files. In total I'm receiving around 11 separate errors which will be listed below.
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTBlob.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTAnimation.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTActionSheet.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTGeolocation.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTImage.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTLinking.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTNetwork.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTSettings.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTText.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTVibration.a'
clang: error: no such file or directory: '/Users/bsoleimany/Library/Developer/Xcode/DerivedData/{projectname}-bgjrrdizntqvulcjdjliktxgrpkw/Build/Products/Debug-iphoneos/libRCTWebSocket.a'
I have already tried switching Build Settings -> Build Active Architecture Only to Yes which gets rid of the errors above but then displays this new error
ld: library not found for -lRNPhotoView
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I looked around for a little but I couldn't find any information about the above error, does anyone know how to get rid of these?
Any suggestions on how to solve this would be greatly appreciated!
Wanted to ask a few clarification is are you trying to archive OR build a release version?
Answering that may help to see whats wrong BUT try unchecking the parallize build.
I encounter that error when i was trying:
1. To archive
2. My case was the build was trying to build at the same time and missed out some library when building. Deactivating that causes the build to run slower BUT making sure the React Library is build first, then the Xcode project. Hope this helps though i had this problem for 1 whole day.

ld: library not found for -lpython3.6m

I m using starcore_for_ios to run python scripts.
What i m doing is:
flutter clean
export STARCORE_PATH='/Users/brijeshlakkad'
export STARCORE_PYTHONVERSION='3.6'
export STARCORE_PYTHONLIBRARY='star_python36,python3.6m'
flutter build ios --no-codesign
and i am getting this error:
when i run flutter build ios --no-codesign
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
ld: warning: directory not found for option
'-L/Users/brijeshlakkad/starcore_for_ios/python.files/python-3.6'
ld: library not found for -lpython3.6m
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
ld: warning: directory not found for option
'-L/Users/brijeshlakkad/starcore_for_ios/python.files/python-3.6'
ld: library not found for -lpython3.6m
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Encountered error while building for device.
2.9s
Python version: _3.6.5_1_
flutter version: 1.0.0
What i have done:
1. Build Active Architecture Only : YES
and
2. Targets >> Build Settings >> Linking >> Other Linker Flags: $(inherited)
As you can see error below

use xcodebuild to creat a CI system, error : "Ld build xxxx normal arm64"

Recently I was asked to creat a CI system, so I tride to use xcodebuild.
But I got Errors, the command is :xcodebuild -sdk iphoneos -configuration Release clean build
Errors:
ld: library not found for -lFMDB
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/ProjectName.build/Release-iphoneos/ProjectName.build/Objects-normal/armv7/ProjectName normal armv7
Ld build/ProjectName.build/Release-iphoneos/ProjectName.build/Objects-normal/arm64/ProjectName normal arm64
I import FMDB by cocoa pods, and Header Search Path has this path "${PODS_ROOT}/Headers/Public/FMDB".
Please help me,thx very much.

Xcode build error after project name change

clang: error: no such file or directory: '/Users/matt/Documents/Xcode/GraphicalSet/GraphicalSet/SetTests/GraphicalSetTests/GraphicalSetTests.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
I tried adding a removing the GraphicalSetTests.m file from compile sources in build phases but to no avail.
There are two extra folders in that path: SetTests/GraphicalSetTests
Go to your ProjectTests - > Build Phases -> Compile Sources
Remove this file ProjectTests.m and try to build again.

Resources