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

no matching function for call to 'Create' #3

Open
shokarta opened this issue Jul 24, 2024 · 8 comments
Open

no matching function for call to 'Create' #3

shokarta opened this issue Jul 24, 2024 · 8 comments

Comments

@shokarta
Copy link

Hello... I am recreating all your guide (just the part of receiving notificaitons, sending I am not realy interest in this specific app) from: https://www.youtube.com/watch?v=QsuoYGysekY but I also all rewrite to CMake, and at point of video 16:45 when I try to build to see if all works (so far of course), i see an error:

C:\Qt\Projects\Sources\MyProject\firebase-qt\src\firebaseqtapp.cpp:96: error: no matching function for call to 'Create'

C:/Qt/Projects/Sources/MyProject/firebase-qt/src/firebaseqtapp.cpp:96:14: error: no matching function for call to 'Create'
    d->app = ::firebase::App::Create(options, &*env, QNativeInterface::QAndroidApplication::context());
             ^~~~~~~~~~~~~~~~~~~~~~~
C:/Qt/Projects/Sources/MyProject/firebase_cpp_sdk/include/firebase/app.h:519:15: note: candidate function not viable: no known conversion from 'QtJniTypes::Context' to 'jobject' (aka '_jobject *') for 3rd argument
  static App* Create(const AppOptions& options, JNIEnv* jni_env,
              ^
C:/Qt/Projects/Sources/MyProject/firebase_cpp_sdk/include/firebase/app.h:482:15: note: candidate function not viable: requires 2 arguments, but 3 were provided
  static App* Create(JNIEnv* jni_env, jobject activity);
              ^
C:/Qt/Projects/Sources/MyProject/firebase_cpp_sdk/include/firebase/app.h:563:15: note: candidate function not viable: requires 4 arguments, but 3 were provided
  static App* Create(const AppOptions& options, const char* name,
              ^

in file firebaseqtapp.cpp on line 96

@dantti
Copy link
Member

dantti commented Jul 24, 2024

It's been a while since I had a need for this, but one important thing is to use the firebase sdk version that was on that tutorial, newer versions do not work, I started another project trying to use cmake and newer version but it's on halt ATM so no update here yet.

@shokarta
Copy link
Author

Hello @dantti, first of all I follow you for a long time already, and I have to thank you for your great work!
Very good news hearing from you that you are working on cmake solution of current version :) I will unpatiently wait for it... please link it here or make it well known when its out... As you know there are not many usefull examples/guides on this topic online :(.
For the time being, I will try to get the SDK version of what was current at date of video making... the C++ will be easy to get, but the iOS SDK probably not as oon firebase homepage is only link to current... by any chance you wont be able to get the iOS SDK of what you used and post it online?

@shokarta
Copy link
Author

hello @dantti,
so according to your recomendation, for now I did rebuilt all the project from CMake to QMake.
However this is still the only issue... I used C++ SDK which was current at the tiem you uploaded that video (16.2.2022) which is version 8.9.0, and this repo has no versions so it should work... however I still having this one error all over:
image
tried all lower versions of c++ sdk up to 7.3.0 with same result... so when crosschecked that firebasee sdk c++ version is not an issue, only posibility I see is issue in your code... would be posible for you to check? as this is for us only blocking point to make your work posible to build...
the issue realy is:
image

@dantti
Copy link
Member

dantti commented Aug 12, 2024

Qt changed that context() object in recent versions something like to<jobject>() should fix it

@shokarta
Copy link
Author

@dantti you are the best :)
if this will help anyone, then after I fixed that conversion simply:
QNativeInterface::QAndroidApplication::context().object()
but then I have milion of errors when declared:
Firebase fb;
in main.cpp
after all day figuring out, of course newest Firebase C++ SDKs works...
so using old ones as suggested was not good move :D... so finaly after weeks of figuring out the Firebase Push notifications work on QMake... so much looking forward for new CMake solution

@dantti
Copy link
Member

dantti commented Oct 3, 2024

@shokarta I pushed a branch wip/firebasecmake which uses Firebase v11, lastest version gave me link issues, I'll try a newer one, so Cmake downloads FirebaseSDK and properly links to it, still gradle is a pain, how is your looking?

@shokarta
Copy link
Author

shokarta commented Oct 4, 2024

honestly from row 48 i dont understand much, so I have to play around to see how far I get.
On the other hand, I am not realy scared of the gradle, however iOS makes me worried more.
I suppose at some point you will make an update on the video from QMake to CMale where you explain step by step of what you did, so we can learn from that?
Thanks dantti, great support from your side!

@dantti
Copy link
Member

dantti commented Oct 4, 2024

Ok found out the issue, also got rid of ulgy Qt::QueuedConnection on client side, it works fine on Android already, notice that 12.3.0 has a link issue which I reported upstream.
Please try on that branch :)
Now let's see how iOS goes...

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

2 participants