Hello everyone! I am struggling with the next erro...
# multiplatform
m
Hello everyone! I am struggling with the next error for quite some time now:
Copy code
'pod install' command failed with an exception:
 Cannot run program "pod" (in directory "/Users/markfrelih/AndroidStudioProjects/app-sdk/iosApp"): error=2, No such file or directory
        
        Full command: pod install
        
        Possible reason: CocoaPods is not installed
        Please check that CocoaPods v1.10 or above is installed.
        
        To check CocoaPods version type 'pod --version' in the terminal
        
        To install CocoaPods execute 'sudo gem install cocoapods'
I have searched this channel for similar issues, tried googling it but nothing helps. 🤷 I’ve tried: • Different versions of ruby • Installing cocoapods via brew instead of gem • https://stackoverflow.com/questions/70869813/android-studio-bumblebee-pod-install-command-failed-with-an-exception-error-2/70968187#70968187 The thing is that navigating to
iosApp
folder and running
pod install
manually works as expected. This is the output:
Copy code
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
What is also interesting that I was able to solve it sometimes by running
./gradlew podInstall
manually and then I was able to sync the project. The things is that I can’t figure out why this sometimes works and sometimes doesn’t (at this moment I can’t get it to work at all). 😅 kdoctor only complains about cocoapods-generate, which is not compatible with ruby 3.0.0+ and afaik is not even needed now. I had it working without cocoapods-generate before. I tried for example using ruby 2.7.6 + cocoapods-generate installed, so kdoctor was all green, but I still could not sync the project. My environment: • cocoapods - 1.11.3 • Ruby - 3.0.3 • Android Studio - Dolphin | 2021.3.1 Patch 1 • Xcode - 13.3 • M1 mac • macOS Monterey - 12.2 Any help is greatly appreciated! 🙏
a
Hi! Did I get it right that the error happens only when running from IDE? Can you compare PATH variable in gradle when it was launched from shell and from IDE?
To find it you can add
println("PATH=${System.getenv("PATH")}")
to your root build.gradle.kts and then run any task or gradle sync
m
Hey! Yeah you did get it right! It really appears that the two are different 🤔
I’ll try to correct the PATH that gradle uses
a
m
Yeah, I tried possible solutions from here as well, but no luck 🤷
a
Are the
$SHELL
values differs in IDE and terminal?
m
Hmmm.. good point! Will check tomorrow 👍
@a-dd Thanks for your help! It appears that the environment that AS uses in the background is using zsh, which was somehow unable to run
pod
command. I am using bash and I was able to run
pod
via it manually. 🤷 The issue is now resolved. Thanks again!
109 Views