I’m new to coding on Xcode and im trying to install Firebase on my project but i have an error that I don’t know how to solve.
I have followed all the instructions from Firebase but still have the issue…
First issue:
Dependencies could not be resolved because no versions of ‘GoogleAppMeasurement’ match the requirement 8.12.0 and root depends on ‘GoogleAppMeasurement’ 8.12.0.
Failed to resolve dependencies
Second issue:
no such module ‘Firebase’
Cannot find ‘FirebaseApp’ in scope
import UIKit
import Firebase
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
How can I fix it?
Thanks for the help 🙂
4
Answers
Version 8.12.0 is still in development. Make sure to specify a release tag instead of the master branch. More details at https://github.com/google/GoogleAppMeasurement/issues/20
As Paul Beusterien correctly pointed out, we shouldn’t use version 8.12.0 as it is still under development. However, I think this issue can happen when using Swift Package Manager (SPM) and ‘master’ as the version rule for the Firebase SDK.
After I’ve changed it to ‘8.11.0 – Next Major’ everything was fetched correctly again and worked perfectly fine. Maybe it is enough to simply change the rules once.
To change the rules simply do the following (see screenshots below):
Good luck!
I solve the issue:
Before delete every firebase package in your project (You see the description in the second answer.
Than add the 8.11.0 Version of the Firebase SDK and
you have to write in the AppDelegate "import Firebase" and not "import FirebaseCore" like in the description from Firebase.
File -> Packages -> Update to Latest Package Versions has resolved this issue for me in Xcode 13.4.1.