Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying to Android results in file not found after adding QtQuick Controls

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

It deploys fine when I remove the imported QtQuick.Controls and replace the StackView with something else.

My Qt version is 5.4.2.

I tried deploying it with 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)
like image 886
uniquenamehere Avatar asked Jun 18 '15 19:06

uniquenamehere


1 Answers

When deploying the application, androiddeployqt will copy a bunch of files which terribly fails on Windows when source or destination paths become longer than 260 characters (yeah, that's a "known feature"). Keeping the Qt installation and the project directory as top level as possible helps to reduce the path lengths and solves the problem. And that's basically it!

like image 188
qCring Avatar answered Oct 29 '22 17:10

qCring