new swift 2 project doesn't recognize pods - xcode

I use xcode 7.2 and today I finished a project and wanted to open another one. I made a new project an made pod init + pod install for swiftyJson and Alamofire and try to run it. I got 19 errors that the pod is unrecognized but I can see the pods in the project files. I asked a friend to open the project on his computer and it runs. The old projects run 100% fine.
How to solve this?

Maybe check your CocoaPods installed version with pod --version. 1.0.0 was released today and may help! I was running into issues with MagicalRecord on the 1.0.0 pre releases yesterday and had to uninstall and then sudo gem install cocoapods -v 0.39.0.
Also, I'm covering some CocoaPods topics here in the near future.

Related

React Native Ruby version error even If I have the correct version installed

I am trying to create a new React Native Project using npx. The whole
npx process is getting failed due to Ruby version. Check the attached
image for more details.
The Ruby version was already updated using
rbenv. You can see the Ruby version in the image attached.
I have
also added the necessary code to the .bash_profile and .zshrc files.
Restarted the terminal and system multiple times but the error is the
same.
I don't understand what I'm doing wrong.
First use rbenv for the ruby setup. I'll recommend to restart the system once done with the ruby setup. take help from here.
Then follow these steps to create the react native project.
1. npx react-native init testproject --skip-install
2. cd testproject
3. yarn install
4. cd ios
5. bundle install (For Intel Chip)
arch -arm64 bundle install (For M1 Chip)
6. bundle exec pod install (For Intel Chip)
arch -arm64 bundle exec pod install (For M1 Chip)

React-Native Error + Bug in Ruby Interpreter: Failed to install CocoaPods dependencies for iOS project, which is required by this template

I am very new to Apple and app programming so please forgive me if I am not asking my questions in the perfect "format" that you might be expecting...
I bought my MacBook Air running on M1 chip just few days ago and would like to program with Xcode and React Native. As I do the common command "npx react-native init AwesomeProject" I got into the error which I saw quite some other people also run into:
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
I tried all of the suggestions available on other posts (assuming I am understanding the remedies correctly and making the changes accordingly) but none seem to work for me.
I tried also the default suggested solution which is:
Please try again manually: "cd ./AwesomeProject/ios && pod install".
And I seem to get something different from others, which is:
Analyzing dependencies Fetching podspec for DoubleConversion from
../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec
Fetching podspec for RCT-Folly from
../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec
Fetching podspec for glog from
../node_modules/react-native/third-party-podspecs/glog.podspec
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.1/lib/ffi/library.rb:275: [BUG]
Bus Error at 0x0000000102a08000 ruby 2.6.3p62 (2019-04-16 revision
67580) [universal.arm64e-darwin20]
and then
You may have encountered a bug in the Ruby interpreter or extension
libraries.
Is it something to do with my Ruby interpreter? If yes, what are the commands I could use to solve the issue???
https://github.com/CocoaPods/CocoaPods/issues/10349#issuecomment-849468291
brew install cocoapods
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
In my case, need to restart my terminal before execute pod install. Monterey + M1.
The top answer doesn't work for me on my MBP M1 so I fixed the issue this way :
Make sure you have opened project.xcworkspace and not the project.xcodeproj
Open the workspace file with xcode with clicking on it then go to File -> Workspace Settings ... -> Build System -> Legacy Build System
Select the project file then the Target then go to Build Settings Tab and Search Paths
Double click on Library Search Paths Debug and move the $(inherited) to the bottom of the list
Do the same for the Release .
Then Build Again and you're good to go .
If you still get any errors run these commands in the ios folder of the react native project and do the above steps again and it will build successfully.
rm -rf ~/Library/Developer/Xcode/DerivedData/
pod deintegrate
pod install
If you are facing this issue in Mac Big Sur, reinstalling CommandLineTools can fix this issue.
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

To add a new pod into an app with existing pod files

I have an app that that I made about 4 months ago which uses pods. This is the first app I ever used pods for. Now I am updating the app and have another pod I wish to implement in the app. I go into the pod file and add the line pod 1234. then in the terminal do I run a pod install or a pod update?
Read some doc on it but still not 100% clear as I am new to the concepts of pods.
pod install to install the new pod and keep the other pods at the previously installed version.
pod update to install the new pod and update the previously installed pods to their latest versions.
Full details here.

Cocoapods: "No Xcode project found, please specify one!"

Cocoapods is giving me this error message when calling pod init:
[!] No Xcode project found, please specify one
I've...
called sudo gem install cocoapods and waited for it to install
dragged in my project directory folder "Hello" (see images)
called pod init
Here's my desktop:
What my directory folder "Hello looks like (sudo gem install cocoapods has already finished
What happens when I try to initialize the pod.
Why does that happen?
if you are using REACT NATIVE or FLUTTER ,make sure go to ios folder ,then pod init
cd ios
pod init
Just close the XCode and terminal once then restart the Terminal. Make sure you select the path to your project folder only.
After calling cd /Users/YOUR_USER_NAME/Desktop/PROJECT_NAME just call a command ~ls and check if the list of the file contains your PROJECT_NAME.xcodeproj. If this file is available, it means you can now set up pod init. Otherwise, you should navigate to the next level and find your PROJECT_NAME.xcodeproj.
Hope it helps! :)
Make sure that you are in the correct directory where you .xcodeproj is located.
My solution:
Using terminal would still not work, so I just used the official Cocoapods application and it worked fine. Just download it, select new podfile and then your project and you're ready to go!
I had the same issue and the problem was because of the space in the directory name. I could see on the Desktop there was no space in the directory name, but in Finder, there was a space in the name. After closing out of XCode and then renaming the folder to have no spaces the issue was solved and 'pod init' worked fine.
My solution:
called sudo gem install cocoapods and waited for it to install
pod setup
dragged in my project directory folder "Hello"
called pod init
https://www.jianshu.com/p/a3b803457b08
It's working for me.
It's working for me .
first import directory in terminal where your .xcodeproj .
then run pod init
it's showing error ([!] No Xcode project found, please specify one)...then run pod install command .. Again it is showing error ([!] NoPodfile' found in the project directory.)`..
then QUIT terminal .. Open again ...
import directory in terminal again Run command pod init ..
Now working fine.
Rename the projectFolder to 7, Project folder should have the same name as the .xcodeproj file has.
Might as well add my 2 cents. I just installed xcode and react native, following this guide: https://dev.to/rob117/how-to-really-set-up-a-react-native-environment-on-mac-248h
Everything seemed to run as expected at first with react-native run-ios...I copied over some react-native files from another project, got some dependency errors, fixed them with npm install, and then I restarted my MacBook. After I booted up again, I ran react-native run-ios and got errors about not being able to launch the iPhone 6 simulator. I couldn't find a fix, so I decided to determine if it was my code or if it was xcode or what. So I went to my main projects directory and started a new react-native project, referencing the link I posted above. After everything installed, I did react-native run-ios again and boom, everything worked fine.
So then I closed xcode, the simulator and the terminal that runs upon starting react-native. I went back to my first project and ran react-native run-ios. boom it's working again, except this strange error error Could not find the following native modules: RNKeychain, RNVectorIcons. Did you forget to run "pod install" ?. I installed cocoapods via brew the first time around, I tried pod install but it complains about no xcode file or something. I've tried pod init, but it tells me No Xcode project found, please specify one. I ran pod setup, no error...seemed to do nothing? I guess it's working because now my simulator is running again.
Maybe I'll just remove the react-native-keychain and react-native-vectoricons npm packages from my package.json and see if it goes away. I don't really understand what coca pods is or why I need it. I'm thinking maybe you should take some time to update xcode, delete node_modules folder and run npm install again, spin up a new react-native project and if it works close xocde, simulator and the terminal and then try to go run your project again.
If it was working fine before and you didn't update anything outside of node_modules folder, remove and reinstall often works for me.
Good luck
I am using ionic, you need to cd to the directory that contains xcode files like (App.xcodeproj + App.xcworkspace) then apply the command
pod init

ld: library not found for -lAeroGear-Push clang: error: linker command failed with exit code 1 (use -v to see invocation)

Problem:
Not able to build the project both using xcode and ionic cli, I do get the below error.
ld: library not found for -lAeroGear-Push clang: error: linker command failed with exit code 1 (use -v to see invocation)
What I am trying to do:
For push notification, I am using aerogear cordova plugin, it works fine in Android but in iOS I do face lot of issues, Is there any solution for this?
Is there any other way to implement a push notification in Ionic 3?
I ran into the same trouble, it was just the pod dependencies that were not installed :
Make sure cocoapods is installed. This command should display the version if it is installed :
pod --version
If cocoapodsis not installed, install it.
sudo gem install cocoapods
install pods dependecies :
cd ./platforms/ios
pod install
Everything should work fine now :
cordova build ios
I got this issue several builds and weeks after I removed cordova-plugin-googlemaps which uses cocoapods. I resolved it by going to the platforms/ios directory and running the command pod install. After getting a message that there were no dependencies, I closed XCode, re-ran the Ionic build command and opened the XCode workspace file.
The following build worked.
(Ionic v4)

Resources