firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
819 stars 424 forks source link

[Question] Correct CocoaPods names are Firebase{Component} or Firebase/{Component} ? #1278

Closed mrtrizer closed 2 years ago

mrtrizer commented 2 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the question here:

In docs here https://firebase.google.com/docs/ios/setup it's said that the name format is Firebase{Component}. But in Dependencies.xml I see Firebase/{Component} and pod utility was unable to resolve this dependency.

Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Firebase/Analytics":
  In Podfile:
    Firebase/Analytics (= 8.15.0)

So I replaced dependencies in format Firebase/{Component} with Firebase{Component} is this correct? Because now it works, but I don't understand why the pods with old names are not resolved now. Are these modules the same? What is the right way to solve the problem? Has the format of name changed? Because I can see in diff that the name format Firebase/{Component} worked before.

Thank you!

google-oss-bot commented 2 years ago

I found a few problems with this issue:

paulinon commented 2 years ago

Hi @mrtrizer,

In the documentation you provided, it says that the Firebase{Component} format is utilized in v9.0 of the iOS SDK. The Unity SDK version you're working with doesn't point to v9.0 of the iOS SDK, so it's best that you don't replace the format of the pods.

I'll be closing this for now. Let me know if an issue arises.

mrtrizer commented 2 years ago

I'm sorry, seems my question was not precise enough. The problem is that CocoaPods can't find Firebase/{Component}

Here is my CocoaPods file, generated during build:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/CocoaPods/Specs'
platform :ios, '11.0'

target 'UnityFramework' do
  pod 'Firebase/Analytics', '8.15.0'
  pod 'Firebase/Auth', '8.15.0'
  pod 'Firebase/Core', '8.15.0'
  pod 'Firebase/Database', '8.15.0'
  pod 'Firebase/Firestore', '8.15.0'
  pod 'Firebase/Functions', '8.15.0'
  pod 'Firebase/Messaging', '8.15.0'
  pod 'Firebase/RemoteConfig', '8.10.0'
  pod 'Firebase/Storage', '8.15.0'
  pod 'GoogleSignIn', '~> 5.0.0'
end
target 'Unity-iPhone' do
end
use_frameworks!

I'm running pod repo update then pod install

I get this output

Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Firebase/Analytics":
  In Podfile:
    Firebase/Analytics (= 8.15.0)

Then I'm fixing CocoaPods according to the docs:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/CocoaPods/Specs'
platform :ios, '11.0'

target 'UnityFramework' do
  pod 'FirebaseAnalytics', '8.15.0'
  pod 'FirebaseAuth', '8.15.0'
  pod 'FirebaseCore', '8.15.0'
  pod 'FirebaseDatabase', '8.15.0'
  pod 'FirebaseFirestore', '8.15.0'
  pod 'FirebaseFunctions', '8.15.0'
  pod 'FirebaseMessaging', '8.15.0'
  pod 'FirebaseRemoteConfig', '8.10.0'
  pod 'FirebaseStorage', '8.15.0'
  pod 'GoogleSignIn', '~> 5.0.0'
end
target 'Unity-iPhone' do
end
use_frameworks!

Than I run pod install and it successfully generates the project.

At first I thought that maybe repos are wrong, but I have reference Podfile from another project and the repos seem to be the same.

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/CocoaPods/Specs'

I have no much experience with CocoaPods. So, maybe I'm doing something wrong.

paulinon commented 2 years ago

Hi @mrtrizer,

Thanks for the clarification. I've tested the Podfile you provided, and it seems that the cause of the issue is the mismatch of your Firebase product versions. Specifically, your Remote Config version is different compared to the other products. Fixing the mismatch resolved the issue for me, but feel free to continue with your current approach if it still works.

mrtrizer commented 2 years ago

Thank you for saving me from an ugly solution! I've forgotten to update FirebaseRemoteConfig and has been misled by the error message. The generated file works correctly when versions of all the components are the same. The problem is solved.