Flutter cocoapods version conflict (Installed But Not Working) - xcode

so simply i am trying to archive my flutter project using Xcode to push it through apple store connect review process, i faced a problem that declare that the cocoapods version is old .. i am using cocoapods through cocoapods app not the gem ..
i simply uninstalled the app cause it's the lastest version of the app (Not of cocoapods) and then uninstalled any cocoapods related previous gems so that cocoapods is totally uninstalled on my machine (M1 Macbook Air) & installed the cocoapods gem using sudo gem install cocoapods .. on flutter doctor -v in my device ~ it shows me that cocoapods is installed but now working
[!] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 ✗ CocoaPods installed but not working. You appear to have CocoaPods installed but it is not working. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it. This can usually be fixed by re-installing CocoaPods. To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
and the weird thing that when i try to re-install cocoapods first i run
gem list --local | grep cocoapods
then i uninstall everything that shows up using sudo gem uninstall command after that when i try flutter doctor -v it still shows me that it's installed but not working, But how when I uninstalled the application and the gems and everything related
Take in mind that when i run pod related command after the gem and application uninstallation it shows me this [!] Unable to locate the CocoaPods.app application bundle. Please ensure the application is available and launch it at least once. zsh: illegal hardware instruction pod.. any Ideas Or Solutions?

Related

cocopods-genrate plugin not found

System
OS : macOS (12.6.1)
CPU : Intel (R) Core - i5
JAVA : OpenJdk 19
Xcode : 14.1
ruby : 2.7
gems : 3.3.11
Im trying to set up the environment for Kotlin Multiplatform for iOS and Android i installed kdoctor, Xcode, Android Studio,OpenJdk and ruby2.7.
Everything is working according to plan but i'am not able to install cocoapods and cocoapods-genrate i tried official documentation of cocoapods https://guides.cocoapods.org/using/getting-started.html#installation and used this command. but kdoctor is not ditectiong cocoapods,
sudo gem install cocoapods
i also tried brew method by this command
brew install cocoapods
now cocoapods is detected but cocoapods-genrate plugin is not detected. and showed this message
"* cocopods-genrate plugin not found
Get cocopods-genrate from https://github.com/square/cocoapods-generate#installation"
i tred this command but nothing happend.
gem install cocoapods-generate
how to properly install cocopods and cocopods-genrate to set up the environment for Kotlin Multiplatform for iOS and Android?
I used this command to install cocoapods
sudo gem install -n /usr/local/bin cocoapods
Then this command to install cocoapods-generate
sudo gem install -n /usr/local/bin cocoapods-generate
and finaly pod setup --verbose to setup the cocoapods.
I followed this answer and now cocoapods and cocoapods-generate is ditected by kdoctor.
How do I install CocoaPods?

Failed task "pod install" on M1 macOS

I am trying to install pods for a react native app , but I can't install the pods. I tried several times with different approaches like the following:
sudo arch -x86_64 gem install ffi and arch -x86_64 pod install
or installing via rosetta terminal
or installing with homebrew
or switching to another ruby version (ruby-2.7.5) with rvm use
but pod install always fails with the following error message: incompatible library version - /Users/user/.rvm/gems/ruby-3.0.0/gems/ffi-1.15.5/lib/ffi_c.bundle it seems like the current ruby version is not compatible with the ffi and the cocoapods version.
Can anyone help me or have another idea why it does not work?
I think another problem could be that it uses different ruby versions within the process of installation because I have ruby installed with homebrew and on another location too.
Steps to follow :
-> remove pods from your system and install it via homebrew
-> close the terminal and start new terminal
-> remove node modules from the project
-> remove pods folder in ios
-> remove podfile.lock
For a clear understanding follow this solution

macOS 11.0.1 - Flutter doctor gives cocopods error

I was stuck with cocoapods problem while trying to install Flutter on my computer. Although I was constantly installing it, it was not seen by the flutter doctor. How can I solve this problem?
blackx#Black-Air ~ % sudo flutter doctor
Password:
Woah! You appear to be trying to run flutter as root.
We strongly recommend running the flutter tool without superuser privileges.
/
📎
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B29 darwin-x64, locale tr-TR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Xcode - develop for iOS and macOS (Xcode 12.3)
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.
To re-install CocoaPods, run:
sudo gem install cocoapods
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.52.1)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Had the same problem.
I just looked up my .bash_history and tried to remember, so I don't know if all below is relevant or in the right order or complete. So here are more or less random commands which might help you.
In the flutter/ios folder
rm Podfile.lock
pod repo update
Elsewhere
sudo chown $(whoami) /usr/local/Homebrew
sudo brew cleanup -d -v
gem pristine ffi --version 1.14.2
curl -L https://get.rvm.io | bash -s stable
rvm install ruby
xcode-select --install
sudo brew tap --repair
brew install cocoapods
brew link cocoapods
git -C /user/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
If you do find out how to actually do it, please remember the order of your commands so you can post them here too :)

tns doctor not working. WARNING: There was a problem with CocoaPods

I tried installing Nativescript on my machine and successfully ran all the commands but when I ran TNS doctor I got the following error.
Verifying CocoaPods. This may take more than a minute, please be patient.
Installing iOS runtime.tns-ios#2.1.1 ../../var/folders/pr/zxhdgq354w36_v4jnkyg89fr0000gn/T/nativescript-check-cocoapods11679-71167-clmpmh/node_modules/tns-ios
Verifying CocoaPods. This may take some time, please be patient..
sandbox-exec: /Users/myname/.rvm/gems/ruby-2.3.1#global/gems/cocoapods-1.0.1/bin/pod: Operation not permitted
WARNING: There was a problem with CocoaPods
Verify that CocoaPods are configured properly.
There seem to be issues with your configuration.
1
I have googled around for a fix but could not get any answer e.g. https://github.com/NativeScript/nativescript-cli/issues/1943
There was a mention of chmodding ./Pods but that didn't work. Has anyone else had this problem and fixed it?
I have installed and checked cocoapods but it still yields the same error.
Last login: Tue Aug 9 19:24:23 on ttys000
XXX-MacBook-Air:~ mine$ sudo gem install cocoapods
Password:
Successfully installed cocoapods-1.0.1
Parsing documentation for cocoapods-1.0.1
Done installing documentation for cocoapods after 4 seconds
1 gem installed
XXX-MacBook-Air:~ mine$ pod --version
1.0.1
`
Install your CocoaPods with superuser permissions.
sudo gem install cocoapods
And then check if they are installed correctly
pod --version
Also, you might want to update your XCode version if you are using older one.
Refer to this issue for similar problem discussed.
You will need a lower version of cocoapods first you will need to remove your current version sudo gem uninstall cocoapods then you can proceed to install
sudo gem install activesupport -v 4.2.6
sudo gem install cocoapods -v 0.39.0
After installing cocoapods you can try creating a demo app and run it
tns create demoApp
cd demoApp
tns run ios
You can ignore tns doctor for now
After some research I found the right answer (at least for me) and paste it for future references.
currently using:
MacOs Sierra with
xcode: v7.3.0
cocoapods: v1.0.1
nativescript: v2.3.0
node: v6.8.1
Steps:
Locate your node_modules folder where your global npm packages are installed (I am using nvm version manager and node v6.8.1 so it was /Users/myuser/.nvm/versions/node/v6.8.1/lib/node_modules/nativescript/config).
open node_modules/nativescript/config/config.json
Change the value of USE_POD_SANDBOX to false
Reason (as act of faith): NativeScript uses the sandbox-pod executable. This may prevent some pods from installing correctly. If you encounter such cases, you can switch to the regular pod executable.
original source: https://github.com/NativeScript/nativescript-cli/issues/1943#issuecomment-246186556
[Cocoapods problems][1]
[1]: https://i.stack.imgur.com/fCWVI.png
[continue Cocoapods problems][2]
[2]: https://i.stack.imgur.com/trSvT.png
[continue Cocoapods problems][3]
[3]: https://i.stack.imgur.com/iwvhK.png

Hyperloop error when processing Cocoapods dependencies

After downloading the hyperloop-examples files, and running appc ti build -p ios, I get errors when Hyperloop finds the CocoaPods dependencies.
The exact error text is:
[ERROR] An error occurred during build after 3s 372ms
[ERROR] pod install returned a non-zero exit code
The only change I had to make was to set sdk-version in tiapp.xml to 5.4.0.v20160608165242 instead of 5.4.0 (pulled this version of the SDK by running appc ti sdk install -b 5_4_X)
appc -v returns 5.2.2
appc ti -v returns 5.0.6
Also, if I remove the Podfile file, the app builds and runs on the simulator. Most of the samples work (obviously not the Third-Party Libraries one). I see in some of the other issues where people were able to get the cocoapod dependencies working, so this may just be a cocoapod issue with my machine.
pod --version returns 1.0.1
pod install provides the error:
Could not automatically select an Xcode project. Specify one in your Podfile like so:
Version 1.0.1 of cocoapods does not work with hyperloop right now. Uninstalled that version and installed 0.39.0 instead resolved the issue.
sudo gem install cocoapods -v 0.39.0
One way that worked for me:
Remove cocoapods
gem uninstall --all --executables cocoapods
Install it again
sudo gem install cocoapods
Make sure you're running latest node lts (4.5.0)
Re-open Appc Studio to see it works

Resources