GithubHelp home page GithubHelp logo

Comments (6)

chaunnt avatar chaunnt commented on July 28, 2024 2

Sad to say... Qt5.14 have bugs on AAB build format, this cause app crash on launching (Store upload is ok. )

Currently, I still use APK build with multi APKs upload for a release.

NOTE for all :)

from qtfirebase.

chaunnt avatar chaunnt commented on July 28, 2024 1

SOLVED MY SELF.
PUT IT HERE IF ANYONE NEED IT
Scenario: build QtFirebase using .pri with AAB support ARMv7 & ARMv8 (and both x86, x86_64 but not tested yet)
Environments:

  • Qt 5.14.1
  • QtCreator 4.11.rc (preview)
  • Firebase (latest up to now 6.9 or something)
  • QtFirebase 1.2.7
  • gradle:3.5.0
    Projects: Qt Subdirs Projects with Quick application & 5 Qt plugins library & pre-built SSL Libraries

problem is about linking libc++.
In baseapp.pro -> disable QMAKE_LFLAGS += -nostdlib++ line or add !versionAtLeast(QT_VERSION, "5.14.0"): QMAKE_LFLAGS += -nostdlib++ (or both if use want it)

Some other problems will come from building old project with new format of Android SDK and QtCreator.
Here are few steps you need to:

  1. Backup your android source in ANDROID_PACKAGE_SOURCE_DIR.
  2. Using QtCreator to create template AndroidManifest.xml(BEWARE: new manifest use some meta for lib / asset, make sure you have it in your project or delete it and use old source)
  3. Merge all firebase com.google.firebase service from old manifest to generated manifest
  4. Merge all build.gradle to generated build.gradle
  5. in BaseApp.pro delete some configs if you had it in your code or QMAKE will generate wrong deployment.json file (I don't know why since the output is not changed :) )
  • TEMPLATE = app
  • TARGET = $$qtLibraryTarget($$TARGET)
  1. update your Path in .pri file of qtfirebase_target.pri
  • in -F$$QTFIREBASE_FRAMEWORKS_ROOT Latest firebase use Firebase<module> (ex: FirebaseMessaging) instead of (ex: Messaging) folder. update it if you use latest firebase
  • replace $$ANDROID_TARGET_ARCH to $${QT_ARCH} :) Same !! (Do not know why because they have same values when running qmake but it works =)) )
  1. in all of your pro / pri, if you include your plugins, change the linking of library to make sure library are built and link correctly with platforms
    Example:
    Old source
    LIBS += -L../GeneralPlugins/ -lGeneralPlugins
    ANDROID_EXTRA_LIBS += $$OUT_PWD/../GeneralPlugins/libGeneralPlugins.so

Updated
LIBS += -L../GeneralPlugins/ -lGeneralPlugins_$${QT_ARCH}
ANDROID_EXTRA_LIBS += $$OUT_PWD/../GeneralPlugins/libGeneralPlugins_$${QT_ARCH}.so

That's all :) you will have them on store
Read more about format of structure of AAB if you need to add anything to native Android.
https://developer.android.com/guide/app-bundle?authuser=1

from qtfirebase.

Larpon avatar Larpon commented on July 28, 2024

Hi @chaunnt,

I haven't had the guts to use the AAB feature yet as the Qt support for it is in a way too early stage/bleeding edge to my liking. Personally I use multiple APK's for all my projects. That said I can't see why it shouldn't work because of QtFirebase? Latest QtFirebase (master branch) builds fine individually with all supported arch's on my setup.

Judging from your output there seem to be a mix of Android NDK's?
I see both r16b and r20 in the output? I've had similar vtable errors in one of my projects but at this time of writing I can't remember how I fixed them - stackoverflow will probably give you some hints. I think it was something with the toolchain using the wrong paths when compiling for arm64_v8a (I.e armv7a and arm64_v8a was used/mixed in the build phase). Try using Android NDK r20 only and double check your paths - and see if that will solve your problems?

Happy bug hunt!

from qtfirebase.

Larpon avatar Larpon commented on July 28, 2024

Updated answer ^

from qtfirebase.

Larpon avatar Larpon commented on July 28, 2024

@chaunnt - thanks for posting a solution. I will have an extra look - and see if we can detect AAB builds somehow and make this easier

from qtfirebase.

davidzwa avatar davidzwa commented on July 28, 2024

I got the build on Android with Qt 5.14.2 working in AAB bundle for armv7 and armv8 (not x86 targets). To be found on QtFirebaseExample as a PR which cannot be closed due to complexity, but still serves a working example.

from qtfirebase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.