Can't create main activity after upgrading to Qt 5.3.2

  • Hello,

    The project I am working on was started with Qt 5.2 (Android app/Linux 64-bit dev host). Upgrading to the various releases hasn't been an issue until today.

    After upgrading to Qt 5.3.2, my app builds fine, but during deployment to the Android target, I get the following error/output:
    E/Qt (16812): Can't create main activity
    E/Qt (16812): --Added-by-androiddeployqt--/qml/QtQuick/Controls/Styles/Desktop/BusyIndicatorStyle.qml
    E/Qt (16812): at android.content.res.AssetManager.openAsset(Native Method)
    E/Qt (16812): at
    E/Qt (16812): at
    E/Qt (16812): at
    E/Qt (16812): at
    E/Qt (16812): at
    E/Qt (16812): at
    E/Qt (16812): at
    E/Qt (16812): at
    E/Qt (16812): at
    E/Qt (16812): at
    E/Qt (16812): at$800(
    E/Qt (16812): at$H.handleMessage(
    E/Qt (16812): at android.os.Handler.dispatchMessage(
    E/Qt (16812): at android.os.Looper.loop(
    E/Qt (16812): at
    E/Qt (16812): at java.lang.reflect.Method.invokeNative(Native Method)
    E/Qt (16812): at java.lang.reflect.Method.invoke(
    E/Qt (16812): at$
    E/Qt (16812): at
    E/Qt (16812): at dalvik.system.NativeStart.main(Native Method)

    This occurs with all my projects, but the samples I've tried all work.

    Has there been a change that requires me to update my code?

    I don't see any obvious differences in the sample code to the way I am doing things.

    Switching back to Qt 5.3.1 allows my projects to build/deploy perfectly.

    Any ideas?



  • You are using a BusyIndicatorStyle object and androiddeployqt reference the wrong file. It's trying to use the desktop file. Can you paste your code witch include your custom busyindicator?

  • That's odd, as I am not using any busy indicator at all - custom or otherwise.

    I am not sure what code to post (or what I can post as it is proprietary) and there are several thousand lines of code, spanning multiple projects (main project and test code - all exhibit the same problem).

    As this only happens when I try to deploy using 5.3.2, but all work fine with 5.3.1, I would think my code is fine, excepting any required changes needed for the new version... are there any?

  • Hey. I have the same problem. Everything is working fine with Qt-5.3.1. I just wanted to upgrade to Qt-5.3.2, for no specific reason. I have compiled both of them from source. I switched the same way that with all previous versions, just exported PATH to have new bin/qmake.

    Now, when I start the installed Qt-android-app, it tries to use Desktop BusyIndicatorStyle.qml: —Added-by-androiddeployqt—/qml/QtQuick/Controls/Styles/Desktop/BusyIndicatorStyle.qml@

    For obvious reasons, there is no such file. But I don't why it is trying to use it.

    Edit: To make it clear, I have never used any BusyIndicator or that kind of style in my project.

  • It seems, that Qt-5.4_alpha does not have this problem.

  • I found the problem(s), and they all stem from androiddeployqt, which is severely buggy.

    When deploying an Android app, androiddeployqt adds a whole bunch of useless crap to the project's android-build/res/values/libs.xml file, including a lot of desktop qml files. The irony is that the "missing" file in question actually exists right where the error message insists it isn't, in android-build/--Added-by-androiddeployqt--/qml/QtQuick/Controls/Styles/Desktop/.

    Commenting out all the unnecessary files (or even just the one it complains about) breaks the build with random errors about QtWebKit/plugins.qmltypes.

    I hope they finally get around to fixing this in the next release - that and the broken support for custom plugin types with androiddeployqt.

  • Have a similar problem in 5.4.1

    E/Qt (18743): Can't create main activity
    E/Qt (18743): --Added-by-androiddeployqt--/qml/QtQuick/Controls/Private/CalendarHeaderModel.qml

  • Had a similar problem, the solution was the put build directory in the top of file system. lengthy paths seem to upset androiddeployqt.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.