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

bug: Firestore fails an iOS app, while on the the web it works good #523

Closed
5 of 16 tasks
okletstryit opened this issue Dec 16, 2023 · 9 comments
Closed
5 of 16 tasks
Labels

Comments

@okletstryit
Copy link

okletstryit commented Dec 16, 2023

Plugin(s)

  • Analytics
  • App
  • App Check
  • Authentication
  • Crashlytics
  • Cloud Firestore
  • Cloud Messaging
  • Cloud Storage
  • Performance
  • Remote Config

Version

5.3.0

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

image

Sometimes it fails to run and I see another issue. But in my main app, It fails as it is on the screenshot

#0 0x0000000106882610 in std::__1::shared_ptrfirebase::firestore::util::Executor::shared_ptr[abi:v160006](std::__1::shared_ptrfirebase::firestore::util::Executor const&) at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:634

Expected behavior

It works the same way as on the Web

Reproduction

https://github.com/okletstryit/failing-ios

Steps to reproduce

git clone https://github.com/okletstryit/failing-ios
cd failing-ios
npm install
npm run buid
npm run sync-ios
npm run start-xcode

press Play in xcode

Other information

No response

Capacitor doctor

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 5.6.0
@capacitor/core: 5.6.0
@capacitor/android: 5.6.0
@capacitor/ios: 5.6.0

Installed Dependencies:

@capacitor/android: not installed
@capacitor/cli: 5.6.0
@capacitor/core: 5.6.0
@capacitor/ios: 5.6.0

[success] iOS looking great! 👌

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.
@okletstryit okletstryit added bug/fix Something isn't working needs: triage labels Dec 16, 2023
@robingenz
Copy link
Member

Thanks for reporting the issue. Please also share your Xcode debug console output after the error occurred.

@okletstryit
Copy link
Author

Xcode debug.txt

Thank you for replying. Here is all the logs I have in Xcode

@okletstryit
Copy link
Author

@robingenz I would be grateful for advice on how to workaround this issue if you know the cause of it until you get it fixed on your side

@robingenz
Copy link
Member

robingenz commented Dec 18, 2023

It seems like you did not set up Firebase correctly. The GoogleService-Info.plist file is missing.
Edit: See https://github.com/capawesome-team/capacitor-firebase/blob/main/docs/firebase-setup.md#ios

@okletstryit
Copy link
Author

@robingenz It seems I did not add it to git, or something went wrong with xCode. I added it to my test repo now, the issue is still here

@robingenz
Copy link
Member

You should not add Firebase packages to XCode manually (e.g. Package.resolved). This is all handled by the Capacitor plugin. I removed the packages and tested your reproduction example and could not find any problems:

⚡️  WebView loaded
⚡️  To Native ->  FirebaseFirestore getDocument 71085217
⚡️  To Native ->  SplashScreen hide 71085218
⚡️  TO JS undefined
⚡️  TO JS {"snapshot":{"path":"users\/2NkGwKiBHFV1K5kDg9fJOcig78u2\/lessons\/lesson_1","id":"lesson_1","data":{"b":2,"a":1}}}

@okletstryit
Copy link
Author

@robingenz Sorry for the dumb question, this is my first capacitor project. Could you please explain what Firebase packages I should remove and from where?

@robingenz
Copy link
Member

These are the necessary changes: robingenz/capawesome-team-capacitor-firebase-issue-523@0cc5d28

@okletstryit
Copy link
Author

@robingenz Thanks so much! It works! I added these "wrong" libraries after reading some of the tutorials.

For those who maybe has the same issue, I removed all Firebase-specific packages from Xcode in App-General-Frameworks section.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants