首页 > 解决方案 > 使用 Qt for Android 启动时,Android 应用程序崩溃

问题描述

我正在qt 的网站上尝试这个示例应用程序。它构建时没有错误,当我尝试在装有 Android 8.1.0 的三星 J7 上运行时,出现白屏,然后应用程序崩溃。在 Qt 创建器中,此消息显示为应用程序输出

E Zygote  : isWhitelistProcess - Process is Whitelisted
E libpersona: scanKnoxPersonas
E libpersona: Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
W SELinux : SELinux selinux_android_compute_policy_index : Policy Index[2],  Con:u:r:zygote:s0 RAM:SEPF_SM-G610F_8.1.0_0008, [-1 -1 -1 -1 0 1]
I SELinux : SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=org.qtproject.example.androidTest4
I zygote  : Late-enabling -Xcheck:jni
D ActivityThread: Added TimaKeyStore provider
D MDO     : MDO if sIsMdo=false, sIsCheckMdo=false, uid = 10234
D Proxy   : mdoP is null: 10234
W System  : ClassLoader referenced unknown path:
I QtCore  : Start
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5Network.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5Qml.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5Gui.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5Quick.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5Widgets.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5Svg.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5Sensors.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5Xml.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5QuickParticles.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5QuickTemplates2.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/app/org.qtproject.example.androidTest4-wQpu1e5t-HXJTHLGN4W7gQ==/lib/arm/libQt5QuickControls2.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/data/org.qtproject.example.androidTest4/qt-reserved-files/plugins/platforms/android/libqtforandroid.so" has unsupported flags DT_FLAGS_1=0x81
I Qt      : qt start
W linker  : "/data/data/org.qtproject.example.androidTest4/qt-reserved-files/plugins/bearer/libqandroidbearer.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/data/org.qtproject.example.androidTest4/qt-reserved-files/plugins/sensors/libqtsensors_android.so" has unsupported flags DT_FLAGS_1=0x81
I Qt      : Sensors start
I zygote  : Do partial code cache collection, code=29KB, data=27KB
I zygote  : After code cache collection, code=29KB, data=27KB
I zygote  : Increasing code cache capacity to 128KB
D OpenGLRenderer: HWUI GL Pipeline
I zygote  : Do partial code cache collection, code=60KB, data=59KB
I zygote  : After code cache collection, code=60KB, data=59KB
I zygote  : Increasing code cache capacity to 256KB
I zygote  : Do full code cache collection, code=125KB, data=102KB
I zygote  : After code cache collection, code=109KB, data=78KB
D         : (null):0 ((null)): QML debugging is enabled. Only use this in a safe environment.
D InputTransport: Input channel constructed: fd=56
D ViewRootImpl@74fba6a[QtActivity]: setView = DecorView@fbadb5b[QtActivity] TM=true MM=false
W Activity: AppLock checkAppLockState locked:false verifying:false pkgName = org.qtproject.example.androidTest4 isInMultiWindowMode:false showWhenLocked:false
D ViewRootImpl@74fba6a[QtActivity]: dispatchAttachedToWindow
V Surface : sf_framedrop debug : 0x4f4c, game : false, logging : 0
D ViewRootImpl@74fba6a[QtActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1080,1920] result=0x7 surface={valid=true 3756800000} changed=true
I zygote  : android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
I OpenGLRenderer: Initialized EGL, version 1.4
D OpenGLRenderer: Swap behavior 2
D libGLESv1: STS_GLApi : DTS, ODTC are not allowed for Package : org.qtproject.example.androidTest4
D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x1920]-format:1
D OpenGLRenderer: eglCreateWindowSurface = 0xe1f0ebc0, 0xdfec3808
D ViewRootImpl@74fba6a[QtActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
D ViewRootImpl@74fba6a[QtActivity]: MSG_WINDOW_FOCUS_CHANGED 1
V InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@aa71336 nm : org.qtproject.example.androidTest4 ic=null
D InputMethodManager: startInputInner - Id : 0
I InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D InputTransport: Input channel constructed: fd=65
D vndksupport: Loading /vendor/lib/hw/android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sphal namespace.
V InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@2c1d237 nm : org.qtproject.example.androidTest4 ic=null
D InputMethodManager: startInputInner - Id : 0
W linker  : "/data/data/org.qtproject.example.androidTest4/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/data/org.qtproject.example.androidTest4/qt-reserved-files/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/data/org.qtproject.example.androidTest4/qt-reserved-files/qml/QtSensors/libdeclarative_sensors.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/data/org.qtproject.example.androidTest4/qt-reserved-files/qml/QtQuick/Window.2/libwindowplugin.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/data/org.qtproject.example.androidTest4/qt-reserved-files/qml/QtQuick/Templates.2/libqtquicktemplates2plugin.so" has unsupported flags DT_FLAGS_1=0x81
W linker  : "/data/data/org.qtproject.example.androidTest4/qt-reserved-files/qml/QtQuick/Controls.2/Fusion/libqtquickcontrols2fusionstyleplugin.so" has unsupported flags DT_FLAGS_1=0x81
W libandroidTest4.so: (null):0 ((null)): QQmlApplicationEngine failed to load component
W libandroidTest4.so: (null):0 ((null)): qrc:/main.qml:42 Cannot assign to non-existent property "footer"
08-23 11:53:51.290 11578 11648 W libandroidTest4.so:
D ViewRootImpl@74fba6a[QtActivity]: MSG_WINDOW_FOCUS_CHANGED 0
D InputTransport: Input channel destroyed: fd=65
D OpenGLRenderer: eglDestroySurface = 0xe1f0ebc0, 0xdfec3800
D ViewRootImpl@74fba6a[QtActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x5 surface={valid=false 0} changed=true


"org.qtproject.example.androidTest4" died.

由于我之前没有在 Qt 上开发 Android 的经验,所以我不知道如何解决这个问题。Qt for Android 中的设置具有最新的 Android SDK、Android Studio 文件夹中的 JRE 和 Android NDK 版本 17。感谢任何指导。

标签: androidqt

解决方案


推荐阅读