6
導入QtQuick.Controls 1.2
和使用StackedWidget
組件後,我現在在部署到Android時出現錯誤,如下所示。缺少的文件AnimationDrawable.qml
不是從Android構建目錄中丟失的,所以我不明白它爲什麼不與APK打包在一起。添加QtQuick控件後未找到文件的Android結果
當我刪除導入的QtQuick.Controls
並用其他東西替換StackView
時,它部署良好。
我的Qt版本是5.4.2。
我試着用Qt 5.3.2進行部署,它按預期工作。
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): \t at android.content.res.AssetManager.openAsset(Native Method)
E/Qt (12767): \t at android.content.res.AssetManager.open(AssetManager.java:313)
E/Qt (12767): \t at android.content.res.AssetManager.open(AssetManager.java:287)
E/Qt (12767): \t at org.qtproject.qt5.android.bindings.QtActivity.copyAsset(QtActivity.java:394)
E/Qt (12767): \t at org.qtproject.qt5.android.bindings.QtActivity.extractBundledPluginsAndImports(QtActivity.java:503)
E/Qt (12767): \t at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:582)
E/Qt (12767): \t at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
E/Qt (12767): \t at android.app.Activity.performCreate(Activity.java:5990)
E/Qt (12767): \t at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
E/Qt (12767): \t at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
E/Qt (12767): \t at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
E/Qt (12767): \t at android.app.ActivityThread.access$800(ActivityThread.java:151)
E/Qt (12767): \t at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
E/Qt (12767): \t at android.os.Handler.dispatchMessage(Handler.java:102)
E/Qt (12767): \t at android.os.Looper.loop(Looper.java:135)
E/Qt (12767): \t at android.app.ActivityThread.main(ActivityThread.java:5254)
E/Qt (12767): \t at java.lang.reflect.Method.invoke(Native Method)
E/Qt (12767): \t at java.lang.reflect.Method.invoke(Method.java:372)
E/Qt (12767): \t at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/Qt (12767): \t at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
如果你在windows上,我猜測:路徑變得太長(> 256個字符是Windows的真正問題)。這隻在導入QtQuick時發生,因爲Styles文件夾將被部署。嘗試在系統上儘可能安裝Qt作爲最高級別,以縮短路徑。這應該做到! – qCring
@qCring:Qt安裝在C:/ Qt/*中,但該項目處於深度路徑。可能會導致相同的行爲?我只是驗證它在Qt 5.3.2上工作 – Phat
是的,我想這同樣適用於目標路徑。我會試一試! – qCring