Deployment on Android causes the file to not be found after adding QtQuick controls

After importing QtQuick.Controls 1.2 and using the StackedWidget component, StackedWidget now receive an error message when deploying to Android, as shown below. The missing AnimationDrawable.qml file is missing from the Android build directory, so I don’t understand why it is not packaged with the APK.

It debugs perfectly when I delete the imported QtQuick.Controls and replace the StackView with something else.

My version of Qt is 5.4.2.

I tried to deploy it using Qt 5.3.2 and it works as expected.

 E/Qt (12767): Can't create main activity E/Qt (12767): java.io.FileNotFoundException: --Added-by-androiddeployqt--/qml/QtQuick/Controls/Styles/Android/drawables/AnimationDrawable.qml E/Qt (12767): at android.content.res.AssetManager.openAsset(Native Method) E/Qt (12767): at android.content.res.AssetManager.open(AssetManager.java:313) E/Qt (12767): at android.content.res.AssetManager.open(AssetManager.java:287) E/Qt (12767): at org.qtproject.qt5.android.bindings.QtActivity.copyAsset(QtActivity.java:394) E/Qt (12767): at org.qtproject.qt5.android.bindings.QtActivity.extractBundledPluginsAndImports(QtActivity.java:503) E/Qt (12767): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:582) E/Qt (12767): at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895) E/Qt (12767): at android.app.Activity.performCreate(Activity.java:5990) E/Qt (12767): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) E/Qt (12767): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) E/Qt (12767): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) E/Qt (12767): at android.app.ActivityThread.access$800(ActivityThread.java:151) E/Qt (12767): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) E/Qt (12767): at android.os.Handler.dispatchMessage(Handler.java:102) E/Qt (12767): at android.os.Looper.loop(Looper.java:135) E/Qt (12767): at android.app.ActivityThread.main(ActivityThread.java:5254) E/Qt (12767): at java.lang.reflect.Method.invoke(Native Method) E/Qt (12767): at java.lang.reflect.Method.invoke(Method.java:372) E/Qt (12767): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) E/Qt (12767): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
+6
source share
1 answer

When you deploy the application, androiddeployqt will copy a bunch of files that terribly fail on Windows when the source or destination paths become longer than 260 characters (yes, this is a well-known function "). Keeping the Qt installation and project directory as high as possible helps to reduce the path length and solves problem. And that’s basically it!

+8
source

Source: https://habr.com/ru/post/989361/


All Articles