Out of the box hello world example does not run on Android
-
This out of the box example "hello world" works for native osx and ios simulator, but not in an Android x86 emulator. For Android, I'm using the lastest SDK with: android-ndk-r13b-darwin-x86_64.zip, and tools_r25.2.3-macosx.zip
import QtQuick 2.7 import QtQuick.Window 2.2 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") MainForm { anchors.fill: parent mouseArea.onClicked: { console.log(qsTr('Clicked on background. Text: "' + textEdit.text + '"')) } } }
Starting remote process.I art : Not late-enabling -Xcheck:jni (already on)
W System : ClassLoader referenced unknown path:
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Network.so: unused DT entry: type 0x1d arg 0x12df0
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Network.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Qml.so: unused DT entry: type 0x1d arg 0x335d6
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Qml.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Gui.so: unused DT entry: type 0x1d arg 0x52dd3
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Gui.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Quick.so: unused DT entry: type 0x1d arg 0x46138
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Quick.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5QuickParticles.so: unused DT entry: type 0x1d arg 0x52e5
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5QuickParticles.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/plugins/platforms/android/libqtforandroid.so: unused DT entry: type 0x1d arg 0x92aa
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/plugins/platforms/android/libqtforandroid.so: unsupported flags DT_FLAGS_1=0x81
I Qt : qt start
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/plugins/bearer/libqandroidbearer.so: unused DT entry: type 0x1d arg 0x16de
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/plugins/bearer/libqandroidbearer.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libPInk4.so: unused DT entry: type 0xf arg 0xf92
D gralloc_ranchu: Emulator without host-side GPU emulation detected.
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so: unused DT entry: type 0x1d arg 0x4bd
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/qml/QtQuick/Window.2/libwindowplugin.so: unused DT entry: type 0x1d arg 0x491
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/qml/QtQuick/Window.2/libwindowplugin.so: unsupported flags DT_FLAGS_1=0x81
W libPInk4.so: (null):0 ((null)): Cannot find EGLConfig, returning null config
W libPInk4.so: (null):0 ((null)): Cannot find EGLConfig, returning null config
W libPInk4.so: (null):0 ((null)): QSGContext::initialize: depth buffer support missing, expect rendering errors
W libPInk4.so: (null):0 ((null)): QSGContext::initialize: stencil buffer support missing, expect rendering errors
E libEGL : called unimplemented OpenGL ES API
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Vertex): failed
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Fragment): failed
W libPInk4.so: (null):0 ((null)): QSGMaterialShader: Shader compilation failed:
W libPInk4.so: (null):0 ((null)): ""
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(opacity): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Vertex): failed
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Fragment): failed
W libPInk4.so: (null):0 ((null)): QSGMaterialShader: Shader compilation failed:
W libPInk4.so: (null):0 ((null)): ""
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(textureScale): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(alphaMin): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(alphaMax): shader program is not linked -
@gkraft4 said in Out of the box hello world example does not run on Android:
D gralloc_ranchu: Emulator without host-side GPU emulation detected.
That's your issue. Your host system doesn't have opengl set up or installed properly. Even on an on board intel gpu you should still be able to run this.
Oh and just a side note, r14 is latest stable with r15 in beta right now. That doesn't matter just letting you know r13 isn't the latest any more. :)
-
@ambershark said in Out of the box hello world example does not run on Android:
That's your issue. Your host system doesn't have opengl set up or installed properly. Even on an on board intel gpu you should still be able to run this.
With HW graphics turned on in the emulator, I'm still getting similar "Shader compilation failed" errors.
Starting remote process.I art : Not late-enabling -Xcheck:jni (already on)
W art : Unexpected CPU variant for X86 using defaults: x86
E art : Failed to send JDWP packet APNM to debugger (-1 of 81): Broken pipe
E art : Failed sending reply to debugger: Broken pipe
I art : Debugger is no longer active
I art : Starting a blocking GC Instrumentation
W System : ClassLoader referenced unknown path:
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Network.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Qml.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Gui.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5Quick.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libQt5QuickParticles.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/plugins/platforms/android/libqtforandroid.so: unsupported flags DT_FLAGS_1=0x81
I Qt : qt start
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/plugins/bearer/libqandroidbearer.so: unsupported flags DT_FLAGS_1=0x81
I art : Do partial code cache collection, code=15KB, data=29KB
I art : After code cache collection, code=15KB, data=29KB
I art : Increasing code cache capacity to 128KB
W linker : /data/app/org.qtproject.example.PInk4-1/lib/x86/libPInk4.so: unused DT entry: type 0xf arg 0xf92
D : HostConnection::get() New Host Connection established 0xde7c3280, tid 3403
I OpenGLRenderer: Initialized EGL, version 1.4
D OpenGLRenderer: Swap behavior 1
W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D OpenGLRenderer: Swap behavior 0
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so: unsupported flags DT_FLAGS_1=0x81
W linker : /data/data/org.qtproject.example.PInk4/qt-reserved-files/qml/QtQuick/Window.2/libwindowplugin.so: unsupported flags DT_FLAGS_1=0x81
D : HostConnection::get() New Host Connection established 0xd0988bc0, tid 3404
D : HostConnection::get() New Host Connection established 0xd09ed100, tid 3406
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : No precision specified for (float)
05-18 08:38:15.318 3383 3406 W libPInk4.so:
W libPInk4.so: (null):0 ((null)): *** Problematic Fragment shader source code ***
W libPInk4.so: #define lowp
W libPInk4.so: #define mediump
W libPInk4.so: #define highp
W libPInk4.so: #line 1
W libPInk4.so: varying lowp vec4 color;
05-18 08:38:15.318 3383 3406 W libPInk4.so:
W libPInk4.so: void main()
W libPInk4.so: {
W libPInk4.so: gl_FragColor = color;
W libPInk4.so: }
W libPInk4.so: ***
W libPInk4.so: (null):0 ((null)): shader compilation failed:
W libPInk4.so: ""
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(opacity): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : No precision specified for (float)
W libPInk4.so: ERROR: 0:4: '' : No precision specified for (float)
W libPInk4.so: ERROR: 0:5: '' : No precision specified for (float)
W libPInk4.so: ERROR: 0:6: '' : No precision specified for (float)
05-18 08:38:15.323 3383 3406 W libPInk4.so:
W libPInk4.so: (null):0 ((null)): *** Problematic Fragment shader source code ***
W libPInk4.so: #define lowp
W libPInk4.so: #define mediump
W libPInk4.so: #define highp
W libPInk4.so: #line 1
W libPInk4.so: varying highp vec2 sampleCoord;
05-18 08:38:15.323 3383 3406 W libPInk4.so:
W libPInk4.so: uniform mediump sampler2D _qt_texture;
W libPInk4.so: uniform lowp vec4 color;
W libPInk4.so: uniform mediump float alphaMin;
W libPInk4.so: uniform mediump float alphaMax;
05-18 08:38:15.323 3383 3406 W libPInk4.so:
W libPInk4.so: void main()
W libPInk4.so: {
W libPInk4.so: gl_FragColor = color * smoothstep(alphaMin,
W libPInk4.so: alphaMax,
W libPInk4.so: texture2D(_qt_texture, sampleCoord).a);
W libPInk4.so: }
W libPInk4.so: ***
W libPInk4.so: (null):0 ((null)): shader compilation failed:
W libPInk4.so: ""
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(textureScale): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(alphaMin): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(alphaMax): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : No precision specified for (float)
05-18 08:38:15.345 3383 3406 W libPInk4.so:
W libPInk4.so: (null):0 ((null)): *** Problematic Fragment shader source code ***
W libPInk4.so: #define lowp
W libPInk4.so: #define mediump
W libPInk4.so: #define highp
W libPInk4.so: #line 1
W libPInk4.so: varying lowp vec4 color;
05-18 08:38:15.345 3383 3406 W libPInk4.so:
W libPInk4.so: void main()
W libPInk4.so: {
W libPInk4.so: gl_FragColor = color;
W libPInk4.so: }
W libPInk4.so: ***
W libPInk4.so: (null):0 ((null)): shader compilation failed:
W libPInk4.so: ""
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(opacity): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : No precision specified for (float)
W libPInk4.so: ERROR: 0:4: '' : No precision specified for (float)
W libPInk4.so: ERROR: 0:5: '' : No precision specified for (float)
W libPInk4.so: ERROR: 0:6: '' : No precision specified for (float)
05-18 08:38:15.349 3383 3406 W libPInk4.so:
W libPInk4.so: (null):0 ((null)): *** Problematic Fragment shader source code ***
W libPInk4.so: #define lowp
W libPInk4.so: #define mediump
W libPInk4.so: #define highp
W libPInk4.so: #line 1
W libPInk4.so: varying highp vec2 sampleCoord;
05-18 08:38:15.349 3383 3406 W libPInk4.so:
W libPInk4.so: uniform mediump sampler2D _qt_texture;
W libPInk4.so: uniform lowp vec4 color;
W libPInk4.so: uniform mediump float alphaMin;
W libPInk4.so: uniform mediump float alphaMax;
05-18 08:38:15.349 3383 3406 W libPInk4.so:
W libPInk4.so: void main()
W libPInk4.so: {
W libPInk4.so: gl_FragColor = color * smoothstep(alphaMin,
W libPInk4.so: alphaMax,
W libPInk4.so: texture2D(_qt_texture, sampleCoord).a);
W libPInk4.so: }
W libPInk4.so: ***
W libPInk4.so: (null):0 ((null)): shader compilation failed:
W libPInk4.so: ""
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(textureScale): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(alphaMin): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(alphaMax): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : No precision specified for (float)
05-18 08:38:15.357 3383 3406 W libPInk4.so:
W libPInk4.so: (null):0 ((null)): *** Problematic Fragment shader source code ***
W libPInk4.so: #define lowp
W libPInk4.so: #define mediump
W libPInk4.so: #define highp
W libPInk4.so: #line 1
W libPInk4.so: varying lowp vec4 color;
05-18 08:38:15.357 3383 3406 W libPInk4.so:
W libPInk4.so: void main()
W libPInk4.so: {
W libPInk4.so: gl_FragColor = color;
W libPInk4.so: }
W libPInk4.so: ***
W libPInk4.so: (null):0 ((null)): shader compilation failed:
W libPInk4.so: ""
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(opacity): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : No precision specified for (float)
W libPInk4.so: ERROR: 0:4: '' : No precision specified for (float)
W libPInk4.so: ERROR: 0:5: '' : No precision specified for (float)
W libPInk4.so: ERROR: 0:6: '' : No precision specified for (float)
05-18 08:38:15.362 3383 3406 W libPInk4.so:
W libPInk4.so: (null):0 ((null)): *** Problematic Fragment shader source code ***
W libPInk4.so: #define lowp
W libPInk4.so: #define mediump
W libPInk4.so: #define highp
W libPInk4.so: #line 1
W libPInk4.so: varying highp vec2 sampleCoord;
05-18 08:38:15.362 3383 3406 W libPInk4.so:
W libPInk4.so: uniform mediump sampler2D _qt_texture;
W libPInk4.so: uniform lowp vec4 color;
W libPInk4.so: uniform mediump float alphaMin;
W libPInk4.so: uniform mediump float alphaMax;
05-18 08:38:15.362 3383 3406 W libPInk4.so:
W libPInk4.so: void main()
W libPInk4.so: {
W libPInk4.so: gl_FragColor = color * smoothstep(alphaMin,
W libPInk4.so: alphaMax,
W libPInk4.so: texture2D(_qt_texture, sampleCoord).a);
W libPInk4.so: }
W libPInk4.so: ***
W libPInk4.so: (null):0 ((null)): shader compilation failed:
W libPInk4.so: ""
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(textureScale): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(alphaMin): shader program is not linked
W libPInk4.so: (null):0 ((null)): QOpenGLShaderProgram::uniformLocation(alphaMax): shader program is not linked -
@gkraft4 said in Out of the box hello world example does not run on Android:
One thing that troubles me is I have x86_64 libraries and emulator, but Qt Creator is targeting x86. It runs fine on my samsung s4 arm device.
That beings up a good point. The ARM device is going to be 32-bit. So creator is targeting the right platform.
My question here though is do you have the appropriately built ARM 32 Qt libs on your target device? If you just tried to load your desktop 64 bit Qt libs that will definitely not work.
It's not just bit depth though, you will need cross compiler ARM 32-bit libs. Intel x86 or x86-64 libs (or AMD64) will not work.