Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many conflicts between Firebase External Dependency Manager (1.2.175) and Facebook SDK (15.1.0) #667

Closed
5 tasks done
josealvarez97 opened this issue Jan 24, 2023 · 5 comments
Labels

Comments

@josealvarez97
Copy link

josealvarez97 commented Jan 24, 2023

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

  • Unity Editor Version: 2021.3.16f1
  • Facebook SDK for Unity Version: 15.1.0
  • Installation Platform & Version: iOS (minimum target version13)— Xcode version 14.2

Google APIs for Unity (imported as .tgz tarballs via Unity Package Manager—which is the recommended method by Firebase staff)

  • Firebase External Dependency Manager for Unity Version: 1.2.175
  • Firebase App (Core) Version: 10.3.0
  • Google Analytics for Firebase Version: 10.3.0
  • Firebase Cloud Messaging Version: 10.3.0

Goals

What do you want to achieve?

I want to implement Facebook SDK alongside Firebase External Dependency Manager and other Firebase libraries.

Expected Results

What do you expect to happen?

I would like to implement both libraries without them conflicting with each other.

Actual Results

What actually happened? Can you provide a stack trace?

My Firebase integration has been working fine for weeks, but the Facebook SDK for Unity conflicts with it because of duplicate DLLs.

(/Library/PackageCache/ — DLL from Google APIs for Unity .tgz tarball)

Multiple precompiled assemblies with the same name Google.VersionHandler.dll included on the current platform. Only one assembly with the same name is allowed per platform. (/Users/josealvarez/Documents/GitHub/ReadingApp/Library/PackageCache/com.google.external-dependency-manager@5bc73dfed43e/ExternalDependencyManager/Editor/Google.VersionHandler.dll)

(/Assets/ — DLL from Facebook SDK .unitypackage custom package)

Multiple precompiled assemblies with the same name Google.VersionHandler.dll included on the current platform. Only one assembly with the same name is allowed per platform. (Assets/PlayServicesResolver/Editor/Google.VersionHandler.dll)

In reality, it's not just the Google Version Handler, but all DLLs inside the external dependency manager.

image

For the record, here are all the compile errors thrown by Unity. They all illustrate the exact same point though.

image

image

image

image

This is how my /Library/PackageCache directory would look if I remove the duplicate DLLs:

image

After attempting to remove the duplicate DLLs located in /Library/PackageCache (these would be the versions installed via Google APIs for Unity which I imported as .tgz tarballs via Unity Package Manager), I get the following error when attempting to build my project.

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: https://guides.cocoapods.org/using/troubleshooting.html 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
    �[0m
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
/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 /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/config.rb:166:in `unicode_normalize'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/config.rb:166:in `installation_root'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/config.rb:226:in `podfile_path'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:30:in `report'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:66:in `report_error'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:396:in `handle_exception'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:337:in `rescue in run'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:324:in `run'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
	from /Users/josealvarez/.gem/ruby/2.6.0/bin/pod:23:in `load'
	from /Users/josealvarez/.gem/ruby/2.6.0/bin/pod:23:in `<main>'
/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 /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/config.rb:166:in `unicode_normalize'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/config.rb:166:in `installation_root'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/config.rb:226:in `podfile_path'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/config.rb:205:in `podfile'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:160:in `verify_podfile_exists!'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:46:in `run'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
	from /Users/josealvarez/.gem/ruby/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
	from /Users/josealvarez/.gem/ruby/2.6.0/bin/pod:23:in `load'
	from /Users/josealvarez/.gem/ruby/2.6.0/bin/pod:23:in `<main>'



pod repo update output:

Updating spec repo `trunk`


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

    export LANG=en_US.UTF-8
    �[0m

UnityEngine.Debug:LogError (object)
Google.Logger:Log (string,Google.LogLevel) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/Logger.cs:136)
Google.IOSResolver:Log (string,bool,Google.LogLevel) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1159)
Google.IOSResolver:OnPostProcessInstallPods (UnityEditor.BuildTarget,string) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:2567)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

I had never encountered this error before, and most workarounds on the internet (example 1, example 2, example 3) have failed to resolve the issue on my system.

What is relevant for the maintainers of this repo is that this error seems to come from the Google DLLs imported by the Facebook SDK for Unity. That is, the same DLLs that I had to de-duplicate are now causing problems. The latest versions of these DLLs did not cause these problems when imported directly from Google, but they break the project when imported from the Facebook SDK.

image

Ideally, I should be able to remove the Google DLLs that come from the Facebook SDK for Unity. If I am not mistaken, this is not trivial for .unitypackage imports. When I try to remove them, the Facebook SDK complains that is unable to find them. Please, consider following up on this other issue #430 asking for a version of the Facebook SDK that can be imported as a .tgz tarball via Unity Package Manager. To the best of my understanding, this would avoid conflicts with duplicates DLLs.

The best solution to this problem would be the one that resolves the issue of of duplicate DLLs. The Facebook SDK for Unity should be able to tell whether the Google APIs for Unity are already located in the project, either in /Library/PackageCache/ or /Assets/. A workaround for the Cocoapods issue would not exactly be the best way to go, but I'll appreciate any advice about how I can move forward with my project.

Steps to Reproduce

What are the steps necessary to reproduce this issue?

  1. Import the Firebase libraries described above from Google APIs for Unity (imported as .tgz tarballs via Unity Package Manager, which is the recommended method by Firebase staff). (Note: It's important to import first the External Dependency Manager and Firebase App (Core) libraries before importing Analytics and Messaging.)
  2. Import the latest version of the Facebook SDK (15.1.0). (Note: I have also tried downgrading to version 14 without success.)
  3. Remove the duplicated DLLs from /Library/PackageCache.
  4. Build and run the project for iOS.

You should see an stack trace with the following error

pod repo update output:

Updating spec repo `trunk`


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

    export LANG=en_US.UTF-8
    �[0m

UnityEngine.Debug:LogError (object)
Google.Logger:Log (string,Google.LogLevel) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/Logger.cs:136)
Google.IOSResolver:Log (string,bool,Google.LogLevel) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:1159)
Google.IOSResolver:OnPostProcessInstallPods (UnityEditor.BuildTarget,string) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/IOSResolver/src/IOSResolver.cs:2567)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

Code Samples & Details

Here's a link to a public GitHub repository that you can use to reproduce the issue. Please note that you will have to have Git LFS installed given that I placed the tarballs in the Assets folder.

image

You won't need a GoogleService-Info.plist file or a Facebook app ID to reproduce the conflict between dependencies on your console.

@josealvarez97
Copy link
Author

Hi @JordiFB, I was wondering if you could help me with this issue, please. Thank you a lot in advance.

@josealvarez97
Copy link
Author

josealvarez97 commented Feb 6, 2023

This comment on issue firebase/quickstart-unity#647 helped me to be able to build my project again. Just delete the ExternalDependencyManager and PlayServicesResolver folders (inside the Assets folder, the ones that come with the Facebook SDK). Make sure you delete the whole folders, and not just the DLLs inside, or the Facebook SDK will complain.

However, I cannot run my app yet. Now I am facing issue #659 again (app crashes at launch on iOS device). I had faced it before, see my comments in such issue.

P.S. One difference from my comment in issue #659 is that now my development version crashes at launch too (not just my production version). At least this will allow me to debug the problem more carefully. I hope that once I find a solution/workaround to my development version, then my production version will behave the same way.

@JordiFB
Copy link
Contributor

JordiFB commented Mar 1, 2023

@josealvarez97 Could you check the latest version 16.0.0? We reorganized the External Dependencies Manager folder to make easy for you to not import, just in case you have another plugin like Firebase.

Upgrade guide here: https://developers.facebook.com/docs/unity/upgrading-7.x

@snappedToGrid
Copy link

I'm using version 16.0.0 along with a Firebase module I downloaded a while ago, and I had the same error.
It seems like I solved it by deleting the 1.2.166 folder that came with the Facebook SDK, and keeping 1.2.175 that I believe came with Firebase.

@JordiFB
Copy link
Contributor

JordiFB commented May 10, 2023

@snappedToGrid FB Unity SDK is delivered with External Dependencies manager v1.2.166. If another plugin like Firebase requires a higher version, you can delete it ( delete the 1.2.166 folder ) or not import the 1.2.166 folder when you are importing the plugin into your project.

@JordiFB JordiFB closed this as completed May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants