React Native Invalid Podfile file: [!] Unable to locate the executable node - ios

I'm using Macbook pro-2020 apple M1 Chip, I have created a new ReactNative project and it runs fine on the simulator but if i have to install any other plugins, and have to install pods. it gives me errors like this.
i have installed all the requirements app running fine but once it comes pod installs it fails each and every time. any help would be much appericiated.

I believe this has been answered in how-to-running-cocoapods-on-apple-silicon-m1
I recommend following the updated answer for 2022. If you haven't already, use Homebrew, even tho it's not recommended by the maintainers. M1 with ARM architecture is amazing but many libraries are still not compatible and need to be run in x86 mode.
I would uninstall everything, including and gems you used originally, and run the following Homebrew commands and link them all....
brew install node
brew install yarn
brew install cocoapods
Reinstalling those should now work when you run pod install inside your ios file. This is what worked for me. Hope this helps.

I was facing the same error, this is what worked for me:
I first reinstalled the node, yarn, CocoaPods, after that I run the following commands:
brew link cocoapods
If still gives you error, remove old linked pod using following command:
rm '/opt/homebrew/bin/pod'
Now run this command again:
brew link cocoapods
Once the above command works successfully, then move to your project's iOS folder and run the following command:
pod install

Related

When I run 'npx cap sync' the terminal just hangs

I run the following commands on my M1 Macbook in my terminal to prepare a build for my phone to test it on xcode. First I do ionic build which works fine. Then I run npx cap sync which works until it gets to this line:
⠙ update ios [info] Found 5 Cordova plugins for ios:
com.adjust.sdk#4.30.0
cordova-plugin-email-composer#0.10.0
cordova-plugin-globalization#1.11.0
cordova-plugin-ionic#5.5.2
cordova-sqlite-storage#6.0.0
⠹ Updating iOS native dependencies with pod install
Then the terminal just hangs, there's no error message. I've tried leaving it but nothing seems to happen. I experience this issue regularly which is frustrating as I need to test my code on my device.
I've tried running sudo arch -x86_64 gem install ffi and then arch -x86_64 pod install in ios/App which both run fine but doesn't seem to fix the above issue.
Sometimes if I delete the ios folder, run npx cap sync then reinstall the ios folder using npx cap add ios. I'll be able to get a build on my phone but this only works sporadically.
I'm looking for a consistent solution to the problem.
Since it is an ionic project one other thing you can try is to run ionic sync command:
ionic cap sync
For me the solution was to reinstall Xcode and delete all Xcode related files. It still takes time to sync but now works consistently.
I actually found since I asked this that moving to a more powerful macbook pro with more RAM actually solved the issue and my terminal no longer hangs. I think my old machine just couldn't handle doing the builds and xcode with the juice it required. Occasionally it will throw an error along the lines of cocoapods but running sudo arch -x86_64 gem install ffi and then arch -x86_64 pod install in ios/App solves this.

unity iOS build AppLovinSDK.h' file not found error

I am trying to build my project project on IOS but every-time I try to build I get this error message.
/Users/usename/Desktop/buildMaster/Libraries/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h:7:9: 'AppLovinSDK/AppLovinSDK.h' file not found
I read that it might be a problem with cocoapods so I tried to reinstall but it does not seem to work.
I also tried to reinstall Xcode but still nothing work
my version cocoapods is the 1.8.4
the unity version is 2020.2.2f1
I finally solved my problem
-I moved to my build folder
-I uninstalled cocoapod 1.8.4
-I installed brew
-with brew I installed cocoapod
-I deleted the workspace file in my build folder
-I runed install --repo-update
-and finally I built it and it worked !

Xcode build with Google UMP SDK fails with 'framework not found'

We make middleware using Cordova and AdMob to show ads. Cordova generates an Xcode project for us. However the resulting Xcode projects now fail to build with the error ld: framework not found UserMessagingPlatform.xcframework.
This appears to be caused by the Google UMP SDK updating to version 1.3.0, which notes "Updated the SDK from a .framework to a .xcframework." I've contacted AdMob support, and they claim the build works for them and haven't provided any useful help.
I have no idea why our builds now fail and I'm at a loss as to what to do about it. Here is a sample Xcode project: https://www.dropbox.com/s/y1ly2c3yi45rop6/TestBuild.ios.project.zip?dl=0
Can anyone identify what has gone wrong with this Xcode project causing it to fail to build, and identify a workaround?
The Issue
The issue appears to be that a framework/dependency is not added to the Xcode project, so it doesn't have the code necessary to compile the application. AdMob relies on that UserMessagingPlatform thing to work, and without the Mobile Ads SDK being present in your codebase, UserMessagingPlatform is missing and your application is essentially asking for code that isn't there. To resolve this, you have to tell cocoapods (a dependency manager, think npm but for Swift/Objective-C) to locate and add the missing code to your project.
First, install cocoapods if you haven't already. I used Homebrew to do this, as it seems to be the only method that worked without headache. Many people already have Homebrew, but if you don't, install that first, then run:
brew install cocoapods
Next, go into your project directory using the Terminal. Once you're in the directory, run:
pod install --repo-update
Reopen your project in Xcode, and it should compile successfully now.
Step by step resolution:
Skip any steps that aren't necessary for your environment.
Install Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Install cocoapods: brew install cocoapods
Open a terminal, navigate to your project directory: cd /path/to/your/project
Update dependencies: pod install --repo-update
Disclaimer: I'm not a Swift or Objective-C developer, and my experience with Apple/Xcode is limited. I also am unfamiliar with "cocoapods" and AdMob. I just downloaded the sample code and worked through the issue until I got it to compile successfully.
Are you using Cocoapods for your XCode project?
This stackoverflow answer suggest updating cocoapods
Try updating cocoapods:
sudo gem install cocoapods
Cocoapods changelog contains fixes for XCFrameworks
.xcframework files can only be used on CocoaPods 1.10.0 or newer, in your sample app you were using 1.8.4.
Update CocoaPods to latest and run pod install again.

Can't install pod in iOS app with Firebase

I am not able to successfully install pods to my project. I am always getting this error:
This is my Podfile (I added FirebaseFirestoreSwift but even when I undo the changes, its still not working):
It was working fine a month ago.
You need to install the latest version of Xcode command line tools using xcode-select --install. If you already have an installed version, you might get an error similar to
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
In that case, try removing the old command line tools from /Library/Developer/CommandLineTools and reinstall it again.

How to install older version on carthage

I need to have carthage for running Appium tests.
While Appium community is still working on supporting XCode9.2, we need to rely on XCode 8.3.3
OS: MacOS High Sierria
XCode version: XCode 8.3.3
Java: 1.9
But when I run command brew install carthage, I am getting below error:
Error: Your Xcode (8.3.3) is too outdated.
Please refer below link, which implies that- XCode9 support for Appium is not yet rolled-out
[https://github.com/facebook/WebDriverAgent/issues/639][1]
Kindly suggest work around in meanwhile.
Thanks
1) First of all be sure to remove everything:
brew uninstall --force carthage
2) Then search the commit that you like from here:
https://github.com/Homebrew/homebrew-core/search?p=2&q=carthage&type=Commits&utf8=✓
3) in your case might be this:
https://github.com/Homebrew/homebrew-core/commit/f74d9ba598c9843552450abeb382cacd0e71d4c0
the one related to Carthage v0.24, which should be compatible with your requirement of working with Xcode 8.3.3.
4) then get the commit identifier f74d9ba598c9843552450abeb382cacd0e71d4c0 and run:
brew install https://github.com/Homebrew/homebrew-core/raw/f74d9ba598c9843552450abeb382cacd0e71d4c0/Formula/carthage.rb
I was having the same problem, but was unable to use brew install. I kept getting a 404 error when trying to do it.
To get an old version I cloned the Carthage project from the repo, changed my working copy to the specified version tag I needed and ran make install. This worked :D

Resources