Firebase.h file not found with CocoaPods - ios

I am trying to add Firebase into my project. I just added below pods into my Xcode project.
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Database'
pod 'Firebase/Auth'
After installing podfile, I try to import firebase into my project. But it gives me an error that Firebase.h is not found.
Above issue will occur when I uncheck the Run script only when installing from [CP] Check pods Manifest.lock. After that I will installed pod using pod install. And then issue will occur.
Error which I got after uncheck the checkbox:
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

I had the same issues on my project,
I wrote manually link the project and its libraries to solve the problem I followed this link steps it worked
https://github.com/invertase/react-native-firebase-docs/blob/master/docs/installation/ios.md
Also, you must check you link binary with libraries on your Xcode project.
Another solution you can delete all pod depend on libs then you pod init
add manual pod libs after pod install

I am having the same error when I execute, on command line, "cordova build ios --release --device" and I am sure the compilation is using the .xcworkspace file. When I build the project from xCode is working ok.
Cordova version: 8.0.0 and 9.0.0
Ionic: 1.0.0
cordova-android: ^8.1.0
cordova-ios: ^5.1.1
This is the log ...
Checking config.xml for pods.
No new pods detects
Reading build config file: /mobile/build.json
Building project: /mobile/platforms/ios/MyProject.xcworkspace
Configuration: Release
Platform: device
Target:
Adding xcodebuildArg: -UseModernBuildSystem=0
Running command: xcodebuild -workspace MyProject.xcworkspace -scheme MyProject -configuration Release -destination generic/platform=iOS -archivePath MyProject.xcarchive archive CONFIGURATION_BUILD_DIR=/mobile/platforms/ios/build/device SHARED_PRECOMPS_DIR=/mobile/platforms/ios/build/sharedpch -UseModernBuildSystem=0
User defaults from command line:
IDEArchivePathOverride = /mobile/platforms/ios/MyProject.xcarchive
UseModernBuildSystem = 0
Build settings from command line:
CONFIGURATION_BUILD_DIR = /mobile/platforms/ios/build/device
SHARED_PRECOMPS_DIR = /mobile/platforms/ios/build/sharedpch
Prepare build
note: Using legacy build system
...
/mobile/platforms/ios/MyProject/Plugins/cordova-plugin-fcm-with-dependecy-updated/FCMPlugin.m:7:9: fatal error:
'Firebase.h' file not found
#import "Firebase.h"
^~~~~~~~~~~~
1 error generated.
** ARCHIVE FAILED **
The following build commands failed:
CompileC /Users/myUser/Library/Developer/Xcode/DerivedData/MyProject-dwfxupwwzcbssmamqfftsijvblyb/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/MyProject.build/Release-iphoneos/MyProject.build/Objects-normal/armv7/FCMPlugin.o MyProject/Plugins/cordova-plugin-fcm-with-dependecy-updated/FCMPlugin.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
(node:8380) UnhandledPromiseRejectionWarning: Error: xcodebuild: Command failed with exit code 65
at ChildProcess.whenDone (/mobile/node_modules/cordova-common/src/superspawn.js:135:23)
at ChildProcess.emit (events.js:197:13)
at maybeClose (internal/child_process.js:984:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
(node:8380) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8380) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Related

React Native Build Failed On IOS

I am facing the below issue while running the command npx react-native run-ios in my Mac Os Monterey machine. Could anybody please help me with this?
** BUILD FAILED **
The following build commands failed:
CompileC /Users/prashanth/Library/Developer/Xcode/DerivedData/myapp-akpvurjcnemajucrerqjfkzzxnng/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCommon.build/Objects-normal/x86_64/RCTTurboModuleManager.o /Users/prashanth/Documents/REPO/app/node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'ReactCommon' from project 'Pods')
(1 failure)
I have the following piece of lines in the Pod file
platform :ios, '9.0'
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
Version of
Node: 15.14.0,
React Native: 0.62.2,
Xcode: 13.4.1
Thank you!
In iOS Folder go to Pods/Pods.xcodeproj/xcuserdata/project.pbxproj
Change all the 'IPHONEOS_DEPLOYMENT_TARGET = 11.0' to 'IPHONEOS_DEPLOYMENT_TARGET = 12.4'. save and run.
Note: every time you pod install, it will change, so you have to do it again. If there is a better approach please do mention it.

Setting up Google SSO with Podfile in Swift

I am trying to set up Google SSO.
My Podfile looks like this:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Recreation-iOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Google SSO
pod 'GoogleSignIn'
# Pods for Recreation-iOS
target 'Recreation-iOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'Recreation-iOSUITests' do
# Pods for testing
end
end
Then in Terminal I ran pod install from inside the repo, but I get an error when I run it:
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+missing+compatible+arch+in+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
- missing compatible arch in ...
https://github.com/CocoaPods/CocoaPods/issues/10541 [open] [3 comments]
4 weeks ago
- I got error when doing pod install, something to do with M1 chip
https://github.com/CocoaPods/CocoaPods/issues/10569 [open] [2 comments]
a week ago
- CocoaPods compatibility with Apple DTK (Apple Silicon)
https://github.com/CocoaPods/CocoaPods/issues/9907 [open] [105 comments]
a day ago
and 3 more at:
https://github.com/cocoapods/cocoapods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%2C%200x0009%29%3A%20missing%20compatible%20arch%20in%20%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%20-%20%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle&type=Issues&utf8=✓
[!] Automatically assigning platform `iOS` with version `14.0` on target `Recreation-iOS` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`
This error message is not descriptive, so I don't know where to go from here.
--
EDIT: I tried the suggestion below and it seemed to work, but I still cannot get it to compile. Am getting this error now:
linker command failed with exit code 1 (use -v to see invocation)
----------------------------------------
SchemeBuildError: Failed to build the scheme "Recreation-iOS"
linker command failed with exit code 1 (use -v to see invocation)
Build target Recreation-iOS:
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Recreation-iOS editor. (in target 'Recreation-iOS' from project 'Recreation-iOS')
Link Recreation-iOS (arm64):
ld: warning: directory not found for option '-F/Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/AppAuth'
ld: warning: directory not found for option '-F/Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/GTMAppAuth'
ld: warning: directory not found for option '-F/Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: framework not found AppAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run custom shell script '[CP] Embed Pods Frameworks':
mkdir -p /Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/Recreation-iOS.app/Frameworks
/Users/mycomputer/Documents/Git/Recreation-iOS/Pods/Target Support Files/Pods-Recreation-iOS/Pods-Recreation-iOS-frameworks.sh: line 42: source: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code
There's a link in the 3rd line of the error message. Following it led to a page with the search string:
dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle
Googling "missing compatible arch" and "2.6.0" led me to this answer (https://github.com/CocoaPods/CocoaPods/issues/10220#issuecomment-730963835):
sudo arch -x86_64 gem install ffi
Then
arch -x86_64 pod install

CocoaPod with debug only dependency fails on xcodebuild

I am working on a private iOS Swift CocoaPod which is supposed to be used for DEBUG builds only. It uses one other CocoaPod as a dependency, which should also be included for DEBUG only. All code in the source files that use this dependency are inside the if #DEBUG swift flag, To achieve this I added it to my PodSpec with the following line:
s.dependency 'OHHTTPStubs/Swift', '~> 9.0', :configurations => :debug
However when I run pod lib lint it fails on Building with `xcodebuild`. step, when I run the lint with --verbose argument I get the following result:
ld: framework not found OHHTTPStubs
clang: error: linker command failed with exit code 1 (use -v to see invocation)
warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
** BUILD FAILED **
The following build commands failed:
Ld /Users/<username>/Library/Developer/Xcode/DerivedData/App-dvhxmheoxqefvffloemufugtmpli/Build/Products/Release-iphonesimulator/<cocoapod_name>/<cocoapod_name>.framework/<cocoapod_name> normal
(1 failure)
When I don't include , :configurations => :debug argument everything works as expected, however when I then add my CocoaPod to my iOS project, this will include the OHHTTPStubs framework in release builds, even when I add my CocoaPod with the , :configurations => :debug argument in the Podfile of my iOS project.

How to set up Private Pods not supporting simulator

I created a private pods that does not support the simulator, and now I run pod lib lint and I get an error:
-ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
Then I used --verbose and saw that it was compiled using the emulator:
CompileC /Users/xx/Library/Developer/Xcode/DerivedData/App-ctxhalwvkdrxongrjlngrlahubld/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/main.o /var/folders/ mb/b7p9jyj93j75p9gl9m0c5yg00000gn/T/CocoaPods-Lint-20200609-54993-yfocd9-xxSDK/App/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/xx/Library/Developer/Xcode/DerivedData/App-ctxhalwvkdrxongrjlngrlahubld/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/main.o /var/folders/ mb/b7p9jyj93j75p9gl9m0c5yg00000gn/T/CocoaPods-Lint-20200609-54993-yfocd9-xxSDK/App/main.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
Obviously, my private pods do not support the simulator. Is there any setting to avoid compiling with the simulator?
I made some attempts, although pod lib lint --skip-import-validation --allow-warnings works, but pod repo push MySpec xxSDK.podspec --skip-import-validation --allow-warnings does not work.
Private Pods I created, using :path =>'../' works, but only for Devices.

Error: unable to spawn process (Argument list too long) Xcode 10.1

Error Log:
PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/../Script-A..B8.sh (in target: C..r)
cd /Projects/...
/bin/sh -c /Users/../Script-A..B8.sh
error: unable to spawn process (Argument list too long)**
I am getting this error while creating an Archive from Xcode (10.1). My build succeeds. I encountered this error after installing below mentioned pods,
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
My Xcode project is a multi target and multi configuration project managed using xconfig file.
I tried disintegrating, installing, updating pod again and again, but no luck.
Enable Legacy System for workspace setting

Resources