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

import firebase not recognised #9821

Closed
A3anVis opened this issue May 19, 2022 · 7 comments
Closed

import firebase not recognised #9821

A3anVis opened this issue May 19, 2022 · 7 comments

Comments

@A3anVis
Copy link

A3anVis commented May 19, 2022

Step 0: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a GitHub issue.
    • If this is a feature request please use the Feature Request template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general (non-iOS) Firebase discussion, use the firebase-talk
    google group.
  • For backend issues, console issues, and other non-SDK help that does not fall under one
    of the above categories, reach out to
    Firebase Support.
  • Once you've read this section and determined that your issue is appropriate for
    this repository, please delete this section.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 13.4
  • Firebase SDK version: 9.0 (also tried 8.15.0)
  • Installation method: Swift Package Manager
  • Firebase Component: Firestore (Auth, Core, Database, Firestore, Messaging, Storage, etc)
  • Target platform(s): iOS [swiftui]

[REQUIRED] Step 2: Xcode does not recognise import firebase

Xcode does not recognise firebase when importing firebase in the app.swift file. That course xcode error message; No such module 'Firebase'

So Build Failed

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

//
// a3aanapp1App.swift
// a3aanapp1
//
// Created by Adriaan Visagie on 2022/05/19.
//

import SwiftUI
import Firebase

@main
struct a3aanapp1App: App {

init() {
      FirebaseApp.configure()
  }

var body: some Scene {
    WindowGroup {
        ContentView()
    }
}

}

// TODO(you): code here to reproduce the problem

I'm new, tried everything I could find and will really appreciate assistance? Thanks Adriaan

@rizafran
Copy link
Contributor

Hi @A3anVis, I tried reproducing the issue, but my sample app builds successfully. Could you confirm if you have tried the following:

  • Delete your Xcode's derived data
  • Open File > Packages then click Reset package caches

Also, make sure that you have followed the steps here.

@A3anVis
Copy link
Author

A3anVis commented May 19, 2022 via email

@rizafran
Copy link
Contributor

Thanks for the update, @A3anVis. My sample app successfully builds even when using CocoaPods (both 8.15.0 and 9.0.0). Could you provide an MCVE that reproduces the issue?

@A3anVis
Copy link
Author

A3anVis commented May 20, 2022 via email

@rizafran
Copy link
Contributor

I'm sorry to hear that, @A3anVis. It's hard for me to identify the issue since it's not reproducible on my sample project. Does the issue only happen in your Xcode 13.4?

@A3anVis
Copy link
Author

A3anVis commented May 22, 2022

UPDATE: (SOLUTION)

Chris Parker @ https://codecrew.codewithchris.com/ solved the issue for me.

Here is what he wrote and it worked for me:

"I just tried to install Firebase again and the problem still exists. I looked a bit closer to the options that had defaulted with regard to the Dependency rule and the option that had defaulted was “Branch”. I changed that to “Up to the next major Version” and the package selections that I was expecting to see did in fact appear so that’s what the problem was."

I just want to say a really big thank you to Chris Parker at codewithchris, he really came through for me.

THANK YOU CHRIS PARKER

In my quest to better myself, are there may be someone that could explain why changing the Dependency rule worked?

Adriaan

@ChrisParkerWA
Copy link

Cheers Adriaan. Appreciate the feedback.

@firebase firebase locked and limited conversation to collaborators Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants