Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Not able to Create QtFirebase object in my main.qml for android.



  • Not able to Create QtFirebase object in my main.qml.

    I 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 :-

    1. classpath 'com.google.gms:google-services:4.3.3'.
    2. implementation 'com.google.android.gms:play-services-base:15.0.1'
    3. implementation 'com.google.firebase:firebase-core:16.0.1'
    4. implementation 'com.google.firebase:firebase-common:16.0.0'
    5. apply plugin: 'com.google.gms.google-services'

    Please see the attached file for complete error. please help me.


  • Lifetime Qt Champion


Log in to reply