Firebase Unity iOS Problems - ios

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.

Related

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

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

Firebase Crashlytics integration stucked at 'We'll be listening for your app to communicate with our servers.' iOS

I m trying to integrate Crashlytics, I have integrated earlier also. In sample project which I created to test it, in that it works fine. but in my actual project it stucks at step 3 "We'll be listening for your app to communicate with our servers."
I have followed all steps including run script
"${PODS_ROOT}/Fabric/run"
Also tried changing Debug information formate to DWARF with DSYM file. But nothing is working. This all is works if I integrate in sample app.
Bellow is the pod file list I m using in my project.
Can anyone please help me to solve this issue. I m stucked here from 2 days.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyProject' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'TPKeyboardAvoidingSwift'
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'XLPagerTabStrip', '~> 9.0.0'
pod 'STPopup'
pod 'Alamofire'
pod 'STRatingControl'
pod 'Hero'
pod 'SDWebImage', '~> 5.0'
pod 'RxSwift', '~> 4.0'
pod 'RxCocoa', '~> 4.0'
pod 'RealmSwift'
pod 'SDWebImage', '~> 5.0'
pod 'MaterialComponents/Snackbar'
pod 'GIFProgressHUD'
pod 'MBProgressHUD', '~> 1.2.0'
pod 'GPUImage'
pod 'Firebase/Messaging'
pod 'Firebase/Analytics'
pod 'Fabric'
pod 'Crashlytics'
target 'MyProjectTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyProjectUITests' do
inherit! :search_paths
# Pods for testing
end
end
I take it this is a migrated app since you are using Fabric dependencies. Your app either did not send a build and run event or it got stuck in an inactive state in the pipeline. If you are using Xcode to test this, I recommend launching your app, closing it, and then opening it from the actual virtual device dashboard. This will make sure that a build and run event is being properly sent to the endpoint.
However, if my above suggestion does not work, then you will need to write in to support(at)fabric(dot)io so they can ask for your AppDelegate init statements and info.plist to confirm what the issue might be.
I have faced the same issue and more research and tried then solved this issue.
Please follow the below steps to successfully configure Firebase Crashlytics.
Uninstall Crashlystics pods like pod 'Firebase/Crashlytics', pod 'Firebase/Analytics'
Remove run script from build settings
Remove Projects from Firebase consoles
Create new projects on firebase consoles
Configures setups like project name, Bundle ID, etc
make sure the bundle id in small laters even your Xcode camelcase for example your bundle id com.DemoFirebase.app then you need set in firebase configure com.demofirebase.app
Add pod 'Firebase/Analytics' in pod file
Execute script pod install in the command
Clean, Build and run the project it will communicate with firebase
Add FirebaseApp.configure() in appdelegate.swift
Clean, Build and run the project it will communicate with firebase
Add pods like pod 'Firebase/Crashlytics'
Add the new Run script in build settings
Clean, Build and run the project it will communicate with firebase
Enable Crashlystics on the Firebase dashboard
Test dummy crash using this code: https://firebase.google.com/docs/crashlytics/test-implementation?authuser=4
Congrats your Crashlystics successfully configures
I hope the above steps will help in your project and reduce more researching times
Thanks and Hits on the vote button
Happy Codings!

This version of OSX is not able to perform the necessary dSYM transformations

[31merror: could not complete submission of dSYM at /Users/XXUSERXX/Library/Developer/Xcode/DerivedData/ProjectName-flcoueeibbfifebpxptgzctdsqel/Build/Intermediates.noindex/ArchiveIntermediates/ProjectNameAlpha/BuildProductsPath/ProjectNameAlpha-iphoneos/ProjectName.app.dSYM:
Error Domain=com.crashlytics.mac.error-domain.process-dsym Code=4 "This version of OSX is not able to perform the necessary dSYM transformations."
UserInfo={NSLocalizedFailureReason=This version of OSX is not able to perform the necessary dSYM transformations.}
[0m Command PhaseScriptExecution failed with a nonzero exit code
** ARCHIVE FAILED **
I'm getting the above error message when I upgraded my MAC Mini (Catalina) latest (16 GB RAM) and XCode to latest version.
I'm working with Jenkins to run test cases for IOS and ones test cases are generated then it will get uploaded to Sonar Qube server.
Things Which I've tired.
Restarting MAC mini, Closed XCode, Checked XCode configuration like "Debug information format" set to Yes,"Debug information format" to "DWARF with dSYM file".
Earlier it was working fine after update it is not generating the build, Fastlane is not installed.
Thanks
Your version of the Fabric pod is not able to handle symbols from the latest version of MacOS. You'll want to update to the latest pod version (1.10.2 as of 10/21/2019). You may need to sudo gem install cocoapods, pod repo update, pod cache clean, target the newer versions in your Podfile (see next paragraph), and pod update.
I had v1.9.0 of the pod and was getting the same error. I had to target '~> 1.10' specifically or it wouldn't update. Since my project also includes the Crashlytics pod, I had to update that one as well ('~> 3.14', specifically).
Build, profit. Best of luck!
Updated: (16th Nov 2020 onwards)
Remove older pod 'Fabric' & pod 'Crashlytics' from Podfile. Add following dependencies.
# Add the pod for Firebase Crashlytics
pod 'Firebase/Crashlytics'
# Recommended: Add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
Older :
Please check whether you are using latest Crashlytics & Fabric library.
pod 'Fabric', '~> 1.10.2'
pod 'Crashlytics', '~> 3.14.0'
Next Step:
update your podfile with these pods
Then run pod install
Now, build the project, it should work.
Here is what I did to make the upload-symbols tool work:
In my Podfile, removed the version limit for Fabric and Crashlytics.
Mine was as follows:
pod 'Fabric', '~> 1.7.13'
pod 'Crashlytics', '~> 3.10.7'
And I changed it to:
pod 'Fabric'
pod 'Crashlytics'
I then executed pod install and then the script was able to function.

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

Xcode Architecture issue

I am using xcode 6.4 in my project, it contains cocoapods where Pods are as follows:
pod 'ZXingObjC', '~> 3.0'
pod 'Google-Mobile-Ads-SDK'
pod 'iRate'
pod 'NewRelicAgent'
pod 'GoogleAnalytics'
pod 'Appirater'
pod 'Crashlytics'
But, after I update my pods I am getting the error which I attached to this image: Error is becuase of one pod
Need One project prefix header file
And add in bulid setting this .pch file.
So
FOR OBJECTIVE_C
yes this podfile should work,
FOR SWIFT add,this line too
use_frameworks!
YOU DON'T HAVE TO MENTION THE VeRSION OF ANY LIBRARY IF NOT MENTIONED ON COCOAPODS.
Lastly if you have taken care of all these
then try cleaning project cmd
+ shift+ k and then run project.
If still not working then delete manually the dependencies folders and reinstall them
# if there is problem with Google MobileAds-ios-Sdk, then you are stuck. Because there is some problem with them, and hence it would be better to install Google MobileAds-ios-Sdk manually only

Resources