Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 4 Support (Qt 6) › Cloud builds crashing

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #25452

    Jon-Paul

    I’ve managed to get cloud builds to build and upload the build to the Google Play Console; it gets accepted and it seems fine.

    However, when I install it on my phone it crashes as soon as it opens. Google Play Console also reports it crashing on several devices.

    If I build the .apk in QtCreator and install it on my phone then it works fine. However, previously it was crashing until I imported my own QML modules with the following:

    set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/qml/MyModule)

    This is what the Google Play Console complains of:

    backtrace:
    #00 pc 0x000000000033c968 /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/lib/arm64/libQt6Qml_arm64-v8a.so (QQmlContext::engine() const) (BuildId: 874e4a9386749dd671a9b22f0e148cb949551b35)
    #01 pc 0x00000000004f2558 /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/lib/arm64/libFelgo_arm64-v8a.so (FelgoApplication::objectCreatedHandler(QObject*, QUrl const&)+48) (BuildId: 6094b222fa05a8427e2816af5f18e0b5cd8143d9)
    #02 pc 0x000000000036aa88 /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/lib/arm64/libQt6Core_arm64-v8a.so (BuildId: 7ca8235d7af9eecefb4d48ea518938f22ef20c3d)
    #03 pc 0x0000000000324a78 /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/lib/arm64/libQt6Qml_arm64-v8a.so (QQmlApplicationEngine::objectCreated(QObject*, QUrl const&)+52) (BuildId: 874e4a9386749dd671a9b22f0e148cb949551b35)
    #04 pc 0x0000000000324a20 /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/lib/arm64/libQt6Qml_arm64-v8a.so (QQmlApplicationEnginePrivate::finishLoad(QQmlComponent*)+444) (BuildId: 874e4a9386749dd671a9b22f0e148cb949551b35)
    #05 pc 0x0000000000324834 /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/lib/arm64/libQt6Qml_arm64-v8a.so (QQmlApplicationEnginePrivate::startLoad(QUrl const&, QByteArray const&, bool)+508) (BuildId: 874e4a9386749dd671a9b22f0e148cb949551b35)
    #06 pc 0x0000000000324b9c /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/lib/arm64/libQt6Qml_arm64-v8a.so (QQmlApplicationEngine::load(QUrl const&)+36) (BuildId: 874e4a9386749dd671a9b22f0e148cb949551b35)
    #07 pc 0x0000000000003f8c /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/lib/arm64/libappmyapp_arm64-v8a.so (main+308) (BuildId: 193289ad9c1205ae7207e031496a15ac404ba7e7)
    #08 pc 0x00000000000444a0 /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/lib/arm64/libplugins_platforms_qtforandroid_arm64-v8a.so (BuildId: baa36386b0f61706ebac77be6f53c855ad8bb47a)
    #09 pc 0x0000000000222244 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148)
    #10 pc 0x0000000000218be8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568)
    #11 pc 0x0000000000284224 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+216)
    #12 pc 0x00000000003e34ac /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+400)
    #13 pc 0x00000000003decfc /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1704)
    #14 pc 0x0000000000757e00 /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1012)
    #15 pc 0x0000000000203994 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20)
    #16 pc 0x000000000011d3ec /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/base.apk (org.qtproject.qt.android.QtNative$7.run)
    #17 pc 0x00000000003d6150 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304)
    #18 pc 0x00000000003dd890 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+204)
    #19 pc 0x00000000003dece0 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1676)
    #20 pc 0x000000000075338c /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+2536)
    #21 pc 0x0000000000203a14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20)
    #22 pc 0x000000000011f64e /data/app/~~hFavA0E3XLTbIxHQWc2oMA==/mycompany.myapp-5ifnpYUZGARdaElFowdNHQ==/base.apk (org.qtproject.qt.android.QtThread$1.run+146)
    #23 pc 0x00000000003d6150 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304)
    #24 pc 0x000000000073b6b8 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776)
    #25 pc 0x0000000000222378 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88)
    #26 pc 0x00000000001bf17c /apex/com.android.art/javalib/arm64/boot.oat (java.lang.Thread.run+76)
    #27 pc 0x0000000000218964 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548)
    #28 pc 0x0000000000284208 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+188)
    #29 pc 0x000000000061fb98 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460)
    #30 pc 0x000000000066e75c /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1184)
    #31 pc 0x00000000000b1690 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204)
    #32 pc 0x00000000000510ac /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

    Any ideas?

    #25454

    Jon-Paul

    Just to clarify. A local build was previously crashing but that was fixed when I added the set lines. I’d never tested installing the cloud builds as I needed to upload something to the Google Play Console before they’d close my account due to inactivity.

    #25460

    Günther
    Felgo Team

    Hi,

    In general, please have a look at these steps to set up your Felgo project for publishing: https://felgo.com/doc/felgo-publishing/#publish-builds

    Specifically, the product stage should be set to “publish” and qml/assets files should be added with qt_add_qml_module instead of deploy_resources.

    The backtrace only shows that the crash happens at startup when the QML engine parses the QML and creates relevant components.

    The fact that in your local build you had to add
    set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/qml/MyModule)
    suggests that in the the cloud build environment, this QML module is not available or not properly linked/packed with APK, similar to your local issue.

    For a comparison between your local build and cloud builds, you can also have a log at the Cloud Builds build log, to see if you spot any potential issues there.

    As we don’t see a general issue with Cloud Builds and standard Felgo projects, this seems specific to your project and setup, and it needs further investigation with the actual project. One of our developers can have a closer look as part of our paid support if you need further assistance.

    Best,
    Günther

    #25461

    Jon-Paul

    Great, thanks. I was pretty certain it was something related to my project setup and not the cloud builds themselves.

    #25464

    Jon-Paul

    I tried that, including commenting out all translation file config I had and also creating an empty project. Still getting the crash.

    I take it the qrc file is auto generated with CMake so I don’t need to add it manually?

    #25465

    Jon-Paul

    I stripped my app back to use the code from the project: Felgo Games – Template – Multi Scene Multi Levels Template and the crash is caused by the ‘import Levels 1.0 as Levels’ statement in SelectLevelScene.qml.

    My app also has custom modules defined in qmldirs so how should these be defined and imported into the project using CMAKE?

    #25469

    Günther
    Felgo Team

    Hi Jon,

    yes, with Felgo 4 / Qt 6 and CMake there’s is no need to manually maintain a QRC file. The SelectLeveLScene of the MultiSceneMultiLevel demo (https://felgo.com/doc/felgo-demos-multiscenemultilevel-example/) does not include the line import Levels 1.0 as Levels.

    Please make sure to use the latest version of the demo. About the way how to include custom QML modules in your project with CMake: Felgo does not place any additional requirements here. You can find some examples how to do it with Qt 6 and CMake e.g. here: https://doc.qt.io/qt-6/cmake-build-reusable-qml-module.html

    Best,
    Günther

    #25473

    Jon-Paul

    Thanks for your help.

    I’m not sure why mine had that line of code in as I’d updated everything. I’ll have to check.

    Are qmldir files deprecated now if you can define a module with qt_add_qml_module?

    #25475

    Günther
    Felgo Team

    Defining your own qmldir file is optional when using qt_add_qml_module. The command generates the qmldir automatically if not specified otherwise.

    The syntax to use a custom QMLDIR looks like this:
    qt_add_qml_module(
    myTarget
    URI MyModule
    VERSION 1.0
    QML_FILES Main.qml
    SOURCES mytype.cpp
    QMLDIR )

    #25477

    Jon-Paul

    I checked that I was on the latest version of Felgo, created a new demo app and it didn’t have the import statement above so that’s all good.

    Then I removed the import statement and replaced it with one importing the folder and it runs fine now. The Hot Reload is also working too.

    I’m going to try out qt_add_qml_module and failing that replace the imports as I did with the demo app.

    Great support, cheers

    #25480

    Jon-Paul

    qt_add_qml_module keeps throwing up errors for me relating to duplicate targets even though there aren’t any duplicates. Anyway, I don’t really see a strong justification to create modules for everything in my app (and I don’t like a bunch of qt_add_qml_module calls in my CMakeLists file anyway) so I’m just going to restructure things to take these out and import via a relative path.

    One thing that was really strange is I stripped out my entire Main.qml to just contain an App.

    This crashes when I install the cloud build and run it on my device:

    App
    {
    }

    This doesn’t:

    App {
    }

    Any idea what’s causing this? The position of the braces shouldn’t make any difference.

    #25484

    Jon-Paul

    As I’ve been adding bits back into my app things are crashing again.

    Essentially, I was defining a module and importing it as the module name (since I like to explicitly state where the component is coming from). I.e.

    import MyModule 1.0 as MyModule

    Then I would access the component in the code using something like:

    myProperty: MyModule.MyComp

    Now that I’m importing the folder

    import "./MyModule"

    The access becomes:

    myProperty: MyComp

    This seems to work but I don’t like the fact I’ve lost my module name. If I try something like

    import "./MyModule" as MyModule

    Then it doesn’t seem to be able to resolve the paths properly, especially if some of the components have the same name as their folder.
    Of course, I can rename things but I’m not really liking the way things are imported by path as to a module that I’ve defined.

    Still, it’s working but I’m going to go back to trying qt_add_qml_module, this time without my qmldirs, as it should work.

    Felgo team, would you be able to add a demo that uses qt_add_qml_module? Just a simple demo like I’d used before but with a module defined. That would be great.

    #25487

    Günther
    Felgo Team

    Hi Jon,

    Thanks for the update. As you mentioned yourself, the syntax of braces in the code should not make a difference at all – this behavior seems quite strange.

    Right now we do not have an example with additional QML modules at hand, we can plan to add one in the future, but it won’t be available anytime soon.

    One suggestion to consider when working with relative paths: Depending on the operating system, the path names can be processed case-sensitive, which may lead to issues on certain platforms while everything works on others.

    Best,
    Günther

    #25491

    Jon-Paul

    I’ve checked the cases but thanks for the suggestion. I’m going to carry on without using modules, after all, the demos don’t use them so this is just a ‘nice to have’ for me

Viewing 14 posts - 1 through 14 (of 14 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded