Qt (QML) android black screen when I run app on device



  • I am trying to build wiLink (https://github.com/jlaine/wilink) on android.The project builds successfully but when I run it on the device I just get a blank screen.I have this in the application output when the application starts.

        W/System.err( 1078): java.lang.ClassNotFoundException: android.graphics.drawable.RippleDrawable
    W/System.err( 1078): 	at java.lang.Class.classForName(Native Method)
    W/System.err( 1078): 	at java.lang.Class.forName(Class.java:217)
    W/System.err( 1078): 	at java.lang.Class.forName(Class.java:172)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.getClass(ExtractStyle.java:388)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:92)
    W/System.err( 1078): 	at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
    W/System.err( 1078): 	at android.app.Activity.performCreate(Activity.java:5008)
    D/dalvikvm( 1078): GC_CONCURRENT freed 209K, 4% free 10925K/11271K, paused 16ms+1ms, total 72ms
    W/System.err( 1078): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    W/System.err( 1078): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
    W/System.err( 1078): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
    W/System.err( 1078): 	at android.app.ActivityThread.access$600(ActivityThread.java:130)
    W/System.err( 1078): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
    W/System.err( 1078): 	at android.os.Handler.dispatchMessage(Handler.java:99)
    W/System.err( 1078): 	at android.os.Looper.loop(Looper.java:137)
    W/System.err( 1078): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    W/System.err( 1078): 	at dalvik.system.NativeStart.main(Native Method)
    W/System.err( 1078): Caused by: java.lang.NoClassDefFoundError: android/graphics/drawable/RippleDrawable
    W/System.err( 1078): 	... 25 more
    W/System.err( 1078): Caused by: java.lang.ClassNotFoundException: android.graphics.drawable.RippleDrawable
    W/System.err( 1078): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
    W/System.err( 1078): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    W/System.err( 1078): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    W/System.err( 1078): 	... 25 more
    W/System.err( 1078): java.lang.ClassNotFoundException: android.graphics.drawable.AnimatedStateListDrawable
    W/System.err( 1078): 	at java.lang.Class.classForName(Native Method)
    W/System.err( 1078): 	at java.lang.Class.forName(Class.java:217)
    W/System.err( 1078): 	at java.lang.Class.forName(Class.java:172)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.getClass(ExtractStyle.java:388)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:93)
    W/System.err( 1078): 	at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
    W/System.err( 1078): 	at android.app.Activity.performCreate(Activity.java:5008)
    W/System.err( 1078): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    W/System.err( 1078): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
    W/System.err( 1078): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
    W/System.err( 1078): 	at android.app.ActivityThread.access$600(ActivityThread.java:130)
    W/System.err( 1078): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
    W/System.err( 1078): 	at android.os.Handler.dispatchMessage(Handler.java:99)
    W/System.err( 1078): 	at android.os.Looper.loop(Looper.java:137)
    W/System.err( 1078): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    W/System.err( 1078): 	at dalvik.system.NativeStart.main(Native Method)
    W/System.err( 1078): Caused by: java.lang.NoClassDefFoundError: android/graphics/drawable/AnimatedStateListDrawable
    W/System.err( 1078): 	... 25 more
    W/System.err( 1078): Caused by: java.lang.ClassNotFoundException: android.graphics.drawable.AnimatedStateListDrawable
    W/System.err( 1078): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
    W/System.err( 1078): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    W/System.err( 1078): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    W/System.err( 1078): 	... 25 more
    W/System.err( 1078): java.lang.ClassNotFoundException: android.graphics.drawable.VectorDrawable
    W/System.err( 1078): 	at java.lang.Class.classForName(Native Method)
    W/System.err( 1078): 	at java.lang.Class.forName(Class.java:217)
    W/System.err( 1078): 	at java.lang.Class.forName(Class.java:172)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.getClass(ExtractStyle.java:388)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:94)
    W/System.err( 1078): 	at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
    W/System.err( 1078): 	at android.app.Activity.performCreate(Activity.java:5008)
    W/System.err( 1078): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    W/System.err( 1078): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
    W/System.err( 1078): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
    W/System.err( 1078): 	at android.app.ActivityThread.access$600(ActivityThread.java:130)
    W/System.err( 1078): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
    W/System.err( 1078): 	at android.os.Handler.dispatchMessage(Handler.java:99)
    W/System.err( 1078): 	at android.os.Looper.loop(Looper.java:137)
    W/System.err( 1078): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    W/System.err( 1078): 	at dalvik.system.NativeStart.main(Native Method)
    W/System.err( 1078): Caused by: java.lang.NoClassDefFoundError: android/graphics/drawable/VectorDrawable
    W/System.err( 1078): 	... 25 more
    W/System.err( 1078): Caused by: java.lang.ClassNotFoundException: android.graphics.drawable.VectorDrawable
    W/System.err( 1078): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
    W/System.err( 1078): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    W/System.err( 1078): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    W/System.err( 1078): 	... 25 more
    W/System.err( 1078): java.lang.NoSuchFieldException: View_paddingStart
    W/System.err( 1078): 	at java.lang.Class.getDeclaredField(Class.java:631)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.getField(ExtractStyle.java:427)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:173)
    W/System.err( 1078): 	at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
    W/System.err( 1078): 	at android.app.Activity.performCreate(Activity.java:5008)
    W/System.err( 1078): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    W/System.err( 1078): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
    W/System.err( 1078): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
    W/System.err( 1078): 	at android.app.ActivityThread.access$600(ActivityThread.java:130)
    W/System.err( 1078): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
    W/System.err( 1078): 	at android.os.Handler.dispatchMessage(Handler.java:99)
    W/System.err( 1078): 	at android.os.Looper.loop(Looper.java:137)
    W/System.err( 1078): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    W/System.err( 1078): 	at dalvik.system.NativeStart.main(Native Method)
    W/System.err( 1078): java.lang.NoSuchFieldException: View_paddingEnd
    W/System.err( 1078): 	at java.lang.Class.getDeclaredField(Class.java:631)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.getField(ExtractStyle.java:427)
    W/System.err( 1078): 	at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:174)
    W/System.err( 1078): 	at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
    W/System.err( 1078): 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
    W/System.err( 1078): 	at android.app.Activity.performCreate(Activity.java:5008)
    W/System.err( 1078): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    W/System.err( 1078): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
    W/System.err( 1078): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
    W/System.err( 1078): 	at android.app.ActivityThread.access$600(ActivityThread.java:130)
    W/System.err( 1078): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
    W/System.err( 1078): 	at android.os.Handler.dispatchMessage(Handler.java:99)
    W/System.err( 1078): 	at android.os.Looper.loop(Looper.java:137)
    W/System.err( 1078): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
    W/System.err( 1078): 	at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err( 1078): 	at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    W/System.err( 1078): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    W/System.err( 1078): 	at dalvik.system.NativeStart.main(Native Method)
    W/ResourceType( 1078): Skipping entry 0x10804be in package table 0 because it is not complex!
    

    It is also complaining about not finding QML components while they are clearly added to the project :

    W/wiLink  ( 1078): (null):0 ((null)): QQmlApplicationEngine failed to load component
    W/wiLink  ( 1078): (null):0 ((null)): qrc:/qml/boot.qml:23 module "QtQuick.Window" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:22 module "QtQuick.Controls" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:21 module "QtQuick" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:20 module "wiLink" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:23 module "QtQuick.Window" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:22 module "QtQuick.Controls" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:21 module "QtQuick" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:20 module "wiLink" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:23 module "QtQuick.Window" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:22 module "QtQuick.Controls" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:21 module "QtQuick" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:20 module "wiLink" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:23 module "QtQuick.Window" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:22 module "QtQuick.Controls" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:21 module "QtQuick" is not installed
    W/wiLink  ( 1078): qrc:/qml/boot.qml:20 module "wiLink" is not installed
    W/wiLink  ( 1078):
    

    Is there something I am missing?I am building the project using Qt Creator and I have Qt for android installed.I tried both on a Windows7 and a Linux/Debian environment and the results are the same.

    Thanks for your time.



  • Hey I just had this problem recently, It was caused by QtSplashScreen, if this project has QtSplashScreen comment or delete it out and try again, I don't know how to fix it but still keep the splash screen though. Hope this helps.



  • Thanks for the reply ,will certainly try the QtSpalshScreen thing when I get on the machine with the proper environment.I have noticed that when you start a new android project with Qt creator the project just runs fine. It is only when I import an external project in my instance of Qt Creator that the problem occurs.I decided to just learn a few basics on android native development ,deal with problems in the native environment ,and hopefuly it will be easier to deal with these on the Qt side of things.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.