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

Linking failed on iOS #171

Open
mrAlmond opened this issue Jul 22, 2022 · 10 comments
Open

Linking failed on iOS #171

mrAlmond opened this issue Jul 22, 2022 · 10 comments

Comments

@mrAlmond
Copy link

Hi, I'm trying to integrate QtFirebase in a Qt iOS app, I've encountered several issues but fortunately I've been able to solve them all (the QtFirebaseExample is probably old now if used with new versions of Xcode and firebase_sdk_cpp).
Now the biggest problem for me is that I'm getting liking errors:

Could not find or use auto-linked library 'swiftCore'
Could not find or use auto-linked library 'swiftQuartzCore'
Could not find or use auto-linked library 'swiftCoreGraphics'
Could not find or use auto-linked library 'swift_Concurrency'
Could not find or use auto-linked library 'swiftFoundation'
Could not find or use auto-linked library 'swiftCompatibility51'
Could not find or use auto-linked library 'swiftObjectiveC'
Could not find or use auto-linked library 'swiftDispatch'
Could not find or use auto-linked library 'swiftDarwin'
Could not find or use auto-linked library 'swiftUIKit'
Could not find or use auto-linked library 'swiftCoreFoundation'
Could not find or use auto-linked library 'swiftCompatibility50'
Could not find or use auto-linked library 'swiftCoreImage'
Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements'
Could not find or use auto-linked library 'swiftMetal'
Could not find or use auto-linked library 'swiftFileProvider'
Could not find or use auto-linked library 'swiftDataDetection'
Could not find or use auto-linked library 'swiftCompatibilityConcurrency'
Could not find or use auto-linked framework 'FBLPromises'

These errors can be solved by adding an empty swift file to the Xcode project, but I'd like to solve it in a better way or by adding the swift file to the QT project (maybe in the .pro file?) but I've found nothing about swift integration on a Qt project.

Please let me know!

Thank you.

PS
Xcode version 13.4.1
firebase_cpp_sdk version 9.2.0

@larpon
Copy link
Owner

larpon commented Jul 22, 2022

Hey and welcome! Thanks for leaving it here for others to know!

As Apple has locked me out of their developer program I'm not personally aware of, nor able to find out, how to solve this "the Qt way", sorry. I hope others might be able to chime in 🙏

@mrAlmond
Copy link
Author

Hi thank you for the fast reply.
Can you suggest me a specific version of the firebase_cpp_sdk that should work well with QtFirebase?
If not possible do you know if there are other alternatives for Qt to integrate Firebase Analytics?
Is the "native" way doable?
Thank you.

@larpon
Copy link
Owner

larpon commented Jul 22, 2022

The last version I tested that everything was working with is 6.7.0 anything beyond that will probably need work as Google tend to break things all the time.

I don't know of any other alternatives with Qt support as QtFirebase provides. I do know there's a Firebase alternative, though, called Supabase - but it doesn't look like there's any C++ support (yet?!)

Since QtFirebase is just a wrapper on top of the firebase_cpp_sdk you should still be able to use it with Qt. Some of the major work in QtFirebase is centered towards the QML exposure of the API which you don't necessarily need (QML is usually just nice to have)

That's all I know 🤷🏼‍♂️

@larpon
Copy link
Owner

larpon commented Jul 22, 2022

... a long shot could also be trying to use the firebase JavaScript sdk in QML - most, if not all, JS can be tweaked to run in QML to some level. Personally I gave up after several attempts with other JS libs - but things might have changed the last few years 🤷🏼‍♂️

@csikosgabor
Copy link

@mrAlmond I compiled the pro files into CMake files via pro2cmake and implemented and manually tested some Firebase services like Analytics, Cloud Messaging, and Crashlytics by providing Qt6 support. The last manually tested and working version was Firebase 8.3.0, and I was able to test Firebase 9.2.0 with your solution in the days.

@mohammadhasanzadeh
Copy link

Hi,
I had to update my Xcode to Xcode 14, and Firebase to 9.0.0,
Now, I have the same issue,
also I added an empty swift file into my Xcode project, but the issue exists yet.
Any workaround!?

@csikosgabor
Copy link

Hi, I had to update my Xcode to Xcode 14, and Firebase to 9.0.0, Now, I have the same issue, also I added an empty swift file into my Xcode project, but the issue exists yet. Any workaround!?

Cloud Messaging and Crashlytics are still work with Xcode 14.1 and Apple SDK 10.7.0 under Qt 6.5.1.

Did you add your *.swift file to your CMakeLists.txt?

set(SOURCES
    # Add your *.cpp files
)

list(APPEND SOURCES MyProject.swift)

qt_add_executable(${CMAKE_PROJECT_NAME} ${SOURCES})

@mohammadhasanzadeh
Copy link

@csikosgabor Thanks for your help, But I using Qt 5.15.2 and qmake (not CMake).
I added my swift file to SOURCES in .pro file but not work.

@mohammadhasanzadeh
Copy link

mohammadhasanzadeh commented Jun 11, 2023

@mrAlmond Did you succeed to fix this issue by adding an empty Swift file?

@mrAlmond
Copy link
Author

At the moment I'm creating a new dummy swift file in Xcode everytime I need to re-run qmake.
This because I still haven't found a way to include that swift file into the Qt project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants