larpon / QtFirebase

An effort to bring Google's Firebase C++ API to Qt + QML
MIT License
283 stars 83 forks source link

Not able to Create QtFirebase object in my main.qml for Android. #148

Closed Kumar-Gaurav123 closed 4 years ago

Kumar-Gaurav123 commented 4 years ago

I eon_Sys-err.zip

followed this link :- https://firebase.google.com/docs/android/setup and attached the available QtFirebase from https://github.com/Larpon/QtFirebase.

My Compiler is :- Qt 5.14.1 for Android

I am able to build the project and deploy the application on android tab successfully and it is notified on the firebase server after deploying on tab.

But when i am creating Analytics Object in main.qml, it is giving below error :-

W System.err: java.lang.NoSuchMethodError: no non-static method "Lcom/google/firebase/FirebaseApp;.isDataCollectionDefaultEnabled()Z" W System.err: at org.qtproject.qt5.android.QtNative.startQtApplication(Native Method) W System.err: at org.qtproject.qt5.android.QtNative$7.run(QtNative.java:390) W System.err: at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61) W System.err: at java.lang.Thread.run(Thread.java:764) W System.err: java.lang.NoSuchMethodError: no non-static method "Lcom/google/firebase/FirebaseApp;.setDataCollectionDefaultEnabled(Z)V" W System.err: at org.qtproject.qt5.android.QtNative.startQtApplication(Native Method) W System.err: at org.qtproject.qt5.android.QtNative$7.run(QtNative.java:390) W System.err: at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61) W System.err: at java.lang.Thread.run(Thread.java:764) E firebase: Java class com/google/firebase/platforminfo/GlobalLibraryVersionRegistrar not found. Please verify the AAR which contains the com/google/firebase/platforminfo/GlobalLibraryVersionRegistrar class is included in your app. E firebase: clazz F firebase: Java class com/google/firebase/platforminfo/GlobalLibraryVersionRegistrar not found. Please verify the AAR which contains the com/google/firebase/platforminfo/GlobalLibraryVersionRegistrar class is included in your app. F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 23350 (qtMainLoopThrea), pid 23223 (.jbl.eoncompact)

It is failing in the below line available at qtfirebare.cpp used to create object for android platform. _firebaseApp = firebase::App::Create(firebase::AppOptions(), env, activity);

I have added below dependencies in my build.gradle file :-

classpath 'com.google.gms:google-services:4.3.3'. implementation 'com.google.android.gms:play-services-base:15.0.1' implementation 'com.google.firebase:firebase-core:16.0.1' implementation 'com.google.firebase:firebase-common:16.0.0' apply plugin: 'com.google.gms.google-services' Please see the attached file for complete error. please help me.

larpon commented 4 years ago

Hi @Kumar-Gaurav123,

F firebase: Java class com/google/firebase/platforminfo/GlobalLibraryVersionRegistrar not found. Please verify the AAR which contains the com/google/firebase/platforminfo/GlobalLibraryVersionRegistrar class is included in your app.

It looks like you might not be building against the latest Firebase C++ SDK or you're building against different (mismatching) versions of the Firebase Android SDK (those versions are set in your build.gradle)?

Have you tried downloading the latest C++ SDK? Maybe also check if the Firebase versions from build.gradle should be bumped to something more recent? Please see this table for info on the recent versions.

I can see the Android SDK currently have the file from the error message: GlobalLibraryVersionRegistrar

larpon commented 4 years ago

@Kumar-Gaurav123 efforts have been made to fix building against 5.14.x in https://github.com/Larpon/QtFirebaseExample/pull/29