'nanopb/pb.h' file not found. Could not build module 'nanopb' - ios

I know this has been answered previously on Stack.
I am currently running Xcode Version 13.4.1 and using cocoapods-1.11.3 but I got that error and I was trying another solution to change the cocoapods to 1.10.2 based on the https://stackoverflow.com/a/63648164/556617 and still getting this error.
I have done the usual steps to see if the following will solve the issue;
Cleaned Build Folder
Removed derived data
Restarted Xcode
I believe this is a module pulled in along with Firebase/Firestore
pods used:-
pod 'Firebase/Auth'
pod 'Firebase/Messaging'
pod 'Firebase/Analytics'
pod 'FirebaseFirestoreSwift'
pod 'Firebase/Database'
pod 'Firebase/Crashlytics'
and more with came along Firebase

Related

Why am I getting the error 'No such module FirebaseUI' in swift?

Every time I try to build I get the error 'No such module FirebaseUI'
Things I have tried:
Clearing derived data
running 'pod update' to make sure all dependencies are up to date
running my install as arch -x86_64 pod install
making sure I am running the app by opening .xcworkspace as opposed to .xcodeproj
Cleaning my build folder(Command+Shift+K)
Deleting my project and redownloading from Git
Adding the FirebaseUI Framework directly to my project
Changing the Scheme to FirebaseCore allows the project to build but the simulator does not open for testing, nor does it run on a physical device.
Running pod deintegrate && pod install, I noted that this command did mention that FirebaseUI was included and that the version was 11.03
Running xcode in Rosetta
I am running this project on a new MacBook Pro with the M1 chip. Previously, my project ran fine on the older intel chip. My Xcode version is 12.5.1, and my OS is 11.4
Here is my pod file:
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
target 'Pikit' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Fixed Pod configuration
# Pods for Pikit
pod 'Firebase'
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Functions'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
pod 'FirebaseUI/Auth'
pod 'FirebaseUI/Email'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/OAuth' # Used for Sign in with Apple, Twitter, etc
# Other Podfiles
pod 'OnboardKit'
# Auto move screen for keyboard
pod 'SDWebImage'
pod 'PureLayout'
pod 'IQKeyboardManagerSwift'
pod 'Google-Mobile-Ads-SDK'
end
Edit
the previously selected answer was working for a while but after changing the version of an unrelated pod the application is showing the same issue.
FirebaseUI version 11 is now broken into submodules so you will need to import individual modules (e.g. import FirebaseAuthUI) rather than previously using just import FirebaseUI. Or instruct your Podfile to use an older version.
From FirebaseUI 11.0.0 release notes:
Breaking change: Broke monolithic FirebaseUI module into separate modules per feature. You'll need to update the imports in your project accordingly.
// FirebaseUI 10.x
import FirebaseUI
// FirebaseUI 11
import FirebaseAuthUI
import FirebaseDatabaseUI
// ...
I recommend you running the pod install command under the x86 architecture because I've seen that running this command native bring some problems, try:
arch -x86_64 pod install
I found a solution but I am going to keep this open as I am not sure it is a permanent solution/ not sure why it worked. This conflicts directly with one of the earlier answers. I removed all FirebaseUI pods besides the base one so that my pods related to fire base include only the following:
pod 'Firebase'
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Functions'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
pod 'FirebaseUI'

Use of unresolved identifier 'Messaging', 'MessagingDelegate', 'MessagingRemoteMessage'

Yesterday I cleared the Derived data folder enitrely and started facing this error.
I tried :
Clearing Derived Data and Clean and rebuild
Deleting all pods using pod deintegrate and reinstall using pod install
Deleting the Podfile.lock file
Run pod update to update the pods
My podfile contains these Firebase pods:
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Firestore'
pod 'Firebase/Database'
But the error still remains. Anyone faced this error lately.
Simply explicitly import 'FirebaseMessaging' in your project, I had to call it explicitly to make it work.
import FirebaseMessaging
Open your project, in Project Navigator click on Pods.xcodeproj and in a targets list check if your pod is installed. If it is not then pods are not installed properly or Firebase might removed it because it was deprecated.

framework not found FirebaseCore

I am getting the following error
ld: framework not found FirebaseCore
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have tried all the things, like cleaning, reintegrating and updating and installing the PODS, nothing seems to work. Please help. Here is my PODFILE. I have been struggling for the past 2 weeks with this crazy thing
target 'MyProject' do
use_modular_headers!
# use_frameworks!
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'SwiftKeychainWrapper'
pod 'FBSDKCoreKit', '4.35'
pod 'FBSDKShareKit', '4.35'
pod 'FBSDKLoginKit', '4.35'
pod 'GoogleSignIn'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'Firebase/Crash'
pod 'FirebaseStorageCache'
end
If you look at the workspace in Xcode but cannot drill into the project from there then your issue is that your workspace is not opening properly. There should be an expand arrow next to the project name in the workspace explorer. In my case it was because the Project file was being opened by Xcode first before it was opening the Workspace. Since the project was already in use it could not be used again by the workspace. There is no appropriate error message to alert you to this situation.
To fix:
Open xcode
Close all projects and workspaces
Close Xcode (Now the next time you open Xcode it will not open your old project first by default)
Open the Workspace file
Now you should be able to drill into your Xcode project from within your workspace.
I wrestled with this problem as a noob to CocoaPods and Analytics and working with Workspaces. I had added CocoaPods and Firebase to an existing application that had not used CocoaPods before. Once you add CocoaPods you should only ever open the Xcode project through the Workspace.
FWIW: I found this link useful to understand what was going on: Xcode Project vs. Xcode Workspace - Differences
Try it to do by Changing the deployment target to iOS 11. It worked for me.

Many build errors after pod update

I have many pods installed in my project. Everything worked fine since my last pod update. After last pod update, I have 28 build errors starting with "Could not build module xxx".
Here is my podfile:
target 'projectXXX' do
use_frameworks!
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'TwitterKit'
pod 'Fabric'
pod 'Crashlytics' end
I tried to uninstall - install cocoapods.
I tried to deintegrate pod from project, install, remove .workspace file and deriveData folder... still got these errors.
I'm running out of ideas. Please, any other solution?
Thanks you very much
EDIT
I have just discovered that my Pods.framework is in red state as visible on screenshot below. Maybe this can help?
First try to remove cocoa pods completely
gem install cocoapods-deintegrate
pod deintegrate
gem install cocoapods-clean
pod clean
Then install again like this
pod setup
open -a Xcode Podfile
In Pod file add like this
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'TestProject' do
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'TwitterKit'
pod 'Fabric'
pod 'Crashlytics'
end
target 'ProjectTests' do
end
pod install
Updating Xcode can resolve this issue. Thing is, pods might support multiple swift versions, so pods should be able to specify a range of swift versions.
Before Updating check if PODS_ROOT user-definer value in Build Settings of target is not deleted may be accidently. If so Try to add PODS_ROOT=${SRCROOT}/Pods
It's possible that you use old pods repositories and after update (that was few month ago) you need to specify which pod repository to use. I suggest that you need old one. See how looks my pod file for old project:
source 'https://github.com/CocoaPods/Old-Specs.git'
platform :ios, '9.0'
use_frameworks!
xcodeproj 'SF'
#link_with 'SF'
target 'SF' do
pod 'TransitionKit'
pod 'MBProgressHUD'
pod 'PureLayout'
pod 'UICountingLabel'
pod 'MWPhotoBrowser', :git => 'https://github.com/pash3r/MWPhotoBrowser.git', :branch => 'skyFlyWork'
end
What could cause the issue:
- Breaking changes in Pods/APIs
- Breaking changes due to support/non-support of Swift versions
If you are using a versioning system (Git, etc.).
Retrieve an older version of Podfile.lock.
Read that file (it's a text file, you can do more somePath/Podfile.lock in Terminal.app), and the "explicit" versions of your pods should be there.
You should get something like:
PODS:
- GSKStretchyHeaderView (1.0.3)
- Masonry (1.1.0)
...
PODFILE CHECKSUM: someCheckSum
COCOAPODS: 1.1.1
When you do pod 'Firebase' you don't specify a version, so you should get the last one. But if some versions are not compatible, you can get issues.
So you may add the '~> 1.0.3' (for instance if I take my example of GSKStretchyHeaderView). More informations on how to use it here.
So this way you should get back on a older version when everything was working. Now, you can check the documentation of each pods (and their respective podspec looking for "hidden" dependencies) and update them one by one checking which one is the culprit, and then maybe rising a flag (an issue) on their repo/git if needed.
For next dev, I'd suggest to set "version", to at least majors using the "optimistic operator ~>". If they respect the rules of versions, (major/minor/patch), then at least determine the major/minor, a patch shouldn't break anything, but fix things. A minor may have breaking change, while a major has a lot of probability to not be compatible with previous work (different declaration, classes renames, etc.).
If you don't use a versioning system like Git, I STRONGLY suggest you do now.
But if that's your case and you still have the issue. Remember a date when everything was working fine after a pod update/install. Then, go to each Git of your pods, and read the history to find the version at that date and set that version in your podfile for that pod.
Shen you are doing pod update which update all libraries most of the libraries on swift4 still some of them in swift3
If libraries are in swift 4 and your project in swift 3.2 you have two possibilities
you can migrate project to swift4
(or)
you need to rollback to the swift 3.2 supported pods
If project in swift4 libraries in swift3 you need to migrate those libraries into swift4 to solve current problem

Firebase Unity iOS Problems

I have setup Firebase successfully under my Android build in Unity, but am really battling getting it working in my iOS build.
Unity Firebase project was setup and looks fine:
I have followed all the steps on:
https://firebase.google.com/docs/unity/setup
I have installed CocoaPods:
skywalker:sl leonard$ pod --version
1.2.0
Here is the top level generated iOS project:
skywalker:sl leonard$ ls
Classes Libraries
Data MapFileParser
Info.plist MapFileParser.sh
LaunchScreen-iPad.png Unity-iPhone
LaunchScreen-iPad.xib Unity-iPhone Tests
LaunchScreen-iPhone.xib Unity-iPhone.xcodeproj
LaunchScreen-iPhoneLandscape.png UnityData.xcassets
LaunchScreen-iPhonePortrait.png build
I don't see the GoogleService-Info.plist file being added and also expected a Podfile (but I'm just guessing that it would generate one).
The project generates errors and trying to manually resolve them just creates more errors.
Here is the project right after the first build:
Trying to resolve this modules disabled error:
Then after building this is what I see:
I then tried adding the GoogleMobileAds.framework iOS framework:
After running again I get these errors:
After reading online about these errors there's a lot of mention around CocoaPods, but running pod init just created a blank workspace and didn't resolve my issue.
I had a similar problem and was able to get my app building in XCode by going to the App's Xcode directory and running "pod init". This created the podfile. I then edited that file with SublimeText (apparently some editors cause problems editing this file, I'm not fully clear on why) and adding the pods I needed. My podfile ended up looking like this:
platform :ios, '7.0'target
'Unity-iPhone' do
pod 'Firebase/Analytics', '~> 3.10'
pod 'Firebase/Auth', '~> 3.10'
pod 'Firebase/Core', '~> 3.10'
pod 'Firebase/Messaging', '~> 3.10'
pod 'Firebase/RemoteConfig', '~> 3.10'
end
I then ran "pod install" in the same directory and that created the .xcworkspace file (this took some time, as it installed several prerequisites). Opening the .xcworkspace file, I was then able to successfully build and run my app. I've run into additional run time issues (which is why I was on StackOverflow today), but that at least got the project compiling.
You will need a copy of the GoogleServices-info.plist file into the app's xcode directory. Unity copied it automatically for me, but YMMV.
Hope this helps.
Could you link the contents of you podfile? If you just added
pod 'Firebase/Core'
then that might not be enough: https://firebase.google.com/docs/ios/setup#available_pods
pod 'Firebase/Core' Prerequisite libraries and Analytics
pod 'Firebase/AdMob' AdMob
pod 'Firebase/Messaging' Cloud Messaging / Notifications
pod 'Firebase/Database' Realtime Database
pod 'Firebase/Invites' Invites
pod 'Firebase/DynamicLinks' Dynamic Links
pod 'Firebase/Crash' Crash Reporting
pod 'Firebase/RemoteConfig' Remote Config
pod 'Firebase/Auth' Authentication
pod 'Firebase/Storage' Storage
You might have to add all pods for the features you are using.
Disclaimer: I'm currently trying to get my build to run on ios as well (works like a charm on android). Just realized this issue myself, I also only included pod 'Firebase/Core' before.

Resources