相关文章推荐

I recently reset one of the work Macs and after pulling one of our repos and trying to do a build, I’ve been getting an error about cocoapods. The project contains Facebook, so I’m use to getting a workspace file, however because of the error, the workspace file is not generated. The console error is as follows.

I have been trying various things, but so far, nothing has helped. I appreciate any suggestions on solutions to the issue. Thank you.

Unity 2019.4.30
Facebook SDK 11

Cocoapods Error

iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.

After the failure, “pod repo update” was executed and succeeded. “pod install” was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: CocoaPods Guides - Troubleshooting for potential solutions.

pod install output:

[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:

export LANG=en_US.UTF-8
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError) from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in unicode_normalize’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in installation_root' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:226:in podfile_path’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/user_interface/error_report.rb:105:in markdown_podfile' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/user_interface/error_report.rb:30:in report’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command.rb:66:in report_error' from /Users/fscmac/.gem/ruby/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in handle_exception’
from /Users/fscmac/.gem/ruby/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in rescue in run' from /Users/fscmac/.gem/ruby/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in run’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command.rb:52:in run' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/bin/pod:55:in <top (required)>’
from /usr/local/bin/pod:23:in load' from /usr/local/bin/pod:23:in
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError) from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in unicode_normalize’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in installation_root' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:226:in podfile_path’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:205:in podfile' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command.rb:160:in verify_podfile_exists!’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command/install.rb:46:in run' from /Users/fscmac/.gem/ruby/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in run’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command.rb:52:in run' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/bin/pod:55:in <top (required)>’
from /usr/local/bin/pod:23:in load' from /usr/local/bin/pod:23:in

pod repo update output:

Updating spec repo cocoapods
Updating spec repo master

[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:

export LANG=en_US.UTF-8

UnityEngine.Debug:LogError (object)
Google.Logger:Log (string,Google.LogLevel) (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/Logger.cs:127)
Google.IOSResolver:Log (string,bool,Google.LogLevel) (at /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1007)
Google.IOSResolver:OnPostProcessInstallPods (UnityEditor.BuildTarget,string) (at /Users/smiles/dev/src/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:2331)
UnityEngine.GUIUtility:processEvent (int,intptr) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)

I am getting exact thing in my project. Just installed Facebook SDK yesterday and get this error. I too have tried many things but nothing has resolved it. Spent countless hours on this so hoping someone has an answer. I just posted this about 30 minutes ago in same forum. When I find a solution I will update my thread. GL

Hmmm, my mac has all the latest of everything too and its not building. What version of what needs to be reverted to what version for it to play nice who knows. I really wish all these version incompatibility issues would go away as these types of problems are the only thing that slows our development down. Maddening.

I agree. I don’t know why this would break on a fresh mac setup. Luckily we have a few other macs at work, but if I were doing this at home with one mac, I’d be in trouble. I still don’t have a solution. I’ve been trying to compare the old mac with the wiped mac to see what is different. So far, no luck.

Edit: The wiped mac was updated to 11.5.2 Big Sur.
The other two macs are on 11.4 still. Not sure if that is relevant.

So I got it to build without the pod error by deselecting “use shell to execute cocoapod tool” but then I get the “can’t find FBSDKCoreKitImport.h”

I now just tried creating a brand new project in Unity’s recommended version, installing only the latest FB SDK package, setting it up with my app ID and using their sample code to get just the id and username. Built it in Unity. Tried building it in Xcode and still get an immediate error "‘FBSDKCoreKitImport.h’ file not found. Even though this header file is found in the Pods directory of the build. Hate this stuff. :frowning:

It looks like this is a Unity bug: somehow it can’t run the pod install command correctly.
But there is a solution, you can install the pods manually!

Right-click on the folder with the assembled build and click the “New Terminal at Folder” there

It will open Terminal, write “pod update” and hit enter. As a result Unity-iPhone.xcworkspace should appear in the folder

Open in Xcode and enjoy the build!)

PS: Additionally, I encountered a problem with the latest Facebook SDK. Dependencies with version 11.0 are not collected in xcode. To fix this, change their version to 11.1.0

 
推荐文章