Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Can't create main activity after upgrading to Qt 5.3.2
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): java.io.FileNotFoundException: --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 android.content.res.AssetManager.open(AssetManager.java:316)
E/Qt (16812): at android.content.res.AssetManager.open(AssetManager.java:290)
E/Qt (16812): at org.qtproject.qt5.android.bindings.QtActivity.copyAsset(QtActivity.java:397)
E/Qt (16812): at org.qtproject.qt5.android.bindings.QtActivity.extractBundledPluginsAndImports(QtActivity.java:506)
E/Qt (16812): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:585)
E/Qt (16812): at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:880)
E/Qt (16812): at android.app.Activity.performCreate(Activity.java:5231)
E/Qt (16812): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/Qt (16812): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
E/Qt (16812): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
E/Qt (16812): at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/Qt (16812): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/Qt (16812): at android.os.Handler.dispatchMessage(Handler.java:102)
E/Qt (16812): at android.os.Looper.loop(Looper.java:136)
E/Qt (16812): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/Qt (16812): at java.lang.reflect.Method.invokeNative(Native Method)
E/Qt (16812): at java.lang.reflect.Method.invoke(Method.java:515)
E/Qt (16812): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/Qt (16812): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
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.
Brexis last edited by
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?
vivelu last edited by
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:
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.
vivelu last edited by
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.
AndrewDK last edited by
Have a similar problem in 5.4.1
E/Qt (18743): Can't create main activity
E/Qt (18743): java.io.FileNotFoundException: --Added-by-androiddeployqt--/qml/QtQuick/Controls/Private/CalendarHeaderModel.qml
Ateef last edited by
Had a similar problem, the solution was the put build directory in the top of file system. lengthy paths seem to upset androiddeployqt.