Shell Script Invocation Error - objective-c

I am using open ssl in my project. I was running this project successfully in xcode 4.0.2. Recently I updated to XCode 4.2. But its showing build errors. here is the error log
Make[1]:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2: No
such file or directory
Could someone help please?
Thanks

Zach,
Are you using the openssl-xcode project that we (Zetetic) published for use with SQLCipher? If so, you should be able to solve this problem by updating to the latest versions of openssl-xcode and sqlcipher from Github. If you used git to clone them, this should update them without a problem:
$ cd your_project/openssl-xcode
$ git pull origin master
$ cd your_project/sqlcipher
$ git pull origin master
The build scripts were updated for use with Xcode 4.2 and LLVM, should work without a hitch. We've updated the tutorial for Xcode 4.2 as well.

Related

Environment variables (zsh terminal) installed through npm on MacOS 12.4 Monterey - SOLVED

Background:
Dear Stackoverflow community. I recently switched from Windows to MacOS and am at a loss how to configure environment variables. Many of the previous questions asked here are about bash instead of zsh.
Goal:
I am trying to install an npm package globally. For instance:
npm install -g vercel
or any other package, and use it in my Visual Studio Code terminal (also zsh). If I want to deploy code I have to use 'npx vercel deploy' every time. I want to be able to use "vercel deploy" but instead I get:
zsh: command not found: vercel
What I tried so far:
Installing the package in zsh and visual studio code terminals (didn't work)
Setting the path equal on both VS and terminal: export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I learned that you need to add environment variabels to a .zshrc file. I don't seem to have a zshrc file. When I do:
sudo ~/.zshrc
Password: XXXXXX
sudo: /Users/vincent/.zshrc: command not found
I am getting another error.
I read in the zsh man file that you should use $HOME/.zshrc instead. Again I am getting the same errors:
vincent#Vincents-MacBook-Air-2 ~ % $HOME/.zshrc
zsh: permission denied: /Users/vincent/.zshrc
vincent#Vincents-MacBook-Air-2 ~ % sudo $HOME/.zshrc
sudo: /Users/vincent/.zshrc: command not found
Update 1:
#slebetman Thank you for your explanation. When I open the terminal I go to home via "cd $HOME" which puts me in in the home directory. However there is no way for me to create a .zshrc file in that directory. Neither via touch or vs code. I am getting the following error: "Unable to write file '/home/.zshrc' (Unknown (FileSystemError): Error: ENOTSUP: operation not supported on socket, open '/home/.zshrc')"
Update 2:
I did manage to find the .zshrc file in visual studio code under /etc. I hope this will work. I was able to overwrite the file with Sudo and add environment variables to it.
Add this to the file .zshrc file under /etc and force overwrite it:
export vercel=/Users/vincent/.npm-global/bin/vercel
Screenshots below for those who will try in the future:
Image with .zshrc file layout
Final remarks:
I don't understand how it is so difficult to add environment variables on Mac while everything else is so easy.
I have read many different questions on stackoverflow, and I can't seem to solve it. Also since I am a newbie I am not allowed to comment on there so I post here in the hope that anyone can help me :)
Best,
Vincent
Note that when you do:
npx vercel deploy
Npm will execute vercel for you without installing it. It does that by temporarily downloading vercel. If you want to run vercel directly without using npx then simply don't use npx. Install it instead:
npm install -g vercel
The -g flag installs the module globally and if the module has a CLI it will be available globally as well (note that depending on your setup you may need admin/sudo privileges to use the -g flag). Now you can run vercel by simply typing:
vercel deploy
This works in all operating systems supported by node.js and npm. That means you can even do this in Windows. In fact I use npm to distribute my tools in a simple cross-platform way so I don't have to support multiple package managers like chocolatey (Windows), homebrew (Mac OS), deb (Debian based distros), rpm (Redhat based distros) etc. (npm does not require your software to be written in node.js - I have published packages on npm written in tcl and bash).

xcode command line tools not able to locate git

On Big Sur, I had XCode CLT installed, but not xcode itself. Git was working fine.
Then I installed XCode and now when I try to run git I get the following message:
git: error: Failed to determine realpath of '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk' (errno=No such file or directory)
git: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -find git 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcode-select: Failed to locate 'git', requesting installation of command line developer tools.
A popup comes up, asks to install CLT and when I say ok, it downloads and installs for a few minutes. But when it's done, I'm right back where I started.
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk does not exist, but there are directories for 10.15, 11.1 and 11.3. But not 10.14.
Run the command:
sudo xcode-select -switch /Library/Developer/CommandLineTools
I had the same experience. The solution was to launch Xcode and complete that first run. It downloaded some stuff as part of the process and git was fine after that.
I was receiving the same block of error messages you were, but in either the line above or below was a tidbit suggesting to run xcodebuild -runFirstLaunch which I suspect would have had the same effect as manually running Xcode that first time.

Incorrect path for Pods-testAppTests/Pods-testAppTests.debug.xcconfig: unable to open file

So I recently uploaded my react-native project on GitHub, then cloned it back to see how it will build(did it for first time... yeah). And on react-native run-ios I got a repetitive error: "react-native-app/ios/Pods/Target Support Files/Pods-testAppTests/Pods-testAppTests.debug.xcconfig: unable to open file (in target "testAppTests" in project "testApp") (in target 'testAppTests' from project 'testApp')
I found a solution, where this:
cd ios
pod deintegrate
pod install
helped me as the project then built and ran correctly.
So my question is, how to upload it to GitHub in a way so it builds always correctly after cloning it?
Update
Checking and editing .gitignore solved this problem.
Maybe this is linked to files which have been added/committed, while they should have been ignored, private and local only (not uploaded to GitHub)
Check your .gitignore: here is one for ReactNative, as explained in "Creating a .gitignore for a Clean React Repository", blog post written by Parker Johansen.
Then, assuming you don't have any pending changes/work in progress, you can, as explained here, apply your new .gitignore to your existing repository:
cd /path/to/local/cloned/repo
# create your .gitignore
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
git push
Finally, clone it again, and see if it compiles better.
The OP adds in the comments:
I found that folder 'Pods' doesn't exist on GitHub, that's why this error occurs, how can I add it to my /ios folder on Github correctly
I advise to check if there is a .gitignore rule which would ignore said folder:
git check-ignore -v Pods/aFile_inside_Pods

library not found for -lProtobuf in Xcode

I'm using Xcode 10.2.1 and objective-c in my project. after using this commond in terminal:
git checkout "specific commit"
I'm bring back my codes to 4 month ago. after using this command in terminal I must change Bundle Identifier (because I'm no longer have access to that developer account).
after that I'm getting this error in Xcode (before that I'm getting error about account, No account for team "*****".):
library not found for -lProtobuf
I tried to delete pod file and reinstall pods by run this command in terminal:
pod install
but the problem not solve.
Try to open your project from its .xcworkspace file instead of .xcodeproj file.

Mojave + Xcode 10 build fails on glog config.h, gflags/gflags.h

I'm testing React Native 0.56.0-rc.2 on Mac OS Mojave and Xcode 10.
Running:
react-native init TestProject --version="0.56.0-rc.2"
cd TestProject
npm run start
react-native run-ios
Which generated some long errors.
Entering Xcode gave me a failure on missing config.h for glog, which I found could be built manually:
cd ./node_modules/react-native/third-party/glog-0.3.4
./configure && make && make install
Which passed that stage, but got me on yet another issue
(...)/node_modules/react-native/third-party/glog-0.3.4/src/glog/logging.h:85:10:
'gflags/gflags.h' file not found
I can't find anything related to RN and this on Google or Stack Overflow, only references to other packages and instructions to install those on a Debian-based system.
Is this a known issue?
Running this from the project directory fixed it for me:
cd ./node_modules/react-native/third-party/glog-0.3.4 && ../../scripts/ios-configure-glog.sh
This manually triggers the config script
A simple and quick resolution.
In Xcode, go to File->Project/Workspace settings.
Change the build system to Legacy Build system.
This is the resolution from Wesley's link. Saw something the other day about posting the direct answer and trying to avoid linking because links / websites can change. I was going to leave this as a comment, but don't have enough rep.
Update
It is a known issue, tracked here:
https://github.com/facebook/react-native/issues/19774
I resolved it by running following steps
In the root of the project, run npm install or yarn - install packages
cd node_modules/react-native - go to node modules directory
scripts/ios-install-third-party.sh - install # node_modules/react-native/third-party
cd third-party - go to newly created third party directory
cd glog-0.3.x - ls -la to find your directory version number or just use tab to auto-complete)
./configure - run setup
cd ../../../../ - change back to your project directory
react-native run-ios or react-native run-android - deploy
If any of these solution does not work, please check your project path. Project path and/or directory names should not contain any
space in its name or you can create project on Desktop or in Documents
directory.
Because of invalid name in project path, React Native project unable to link / add glob header files inside project / workspace.