[Android-development] QAndroidStyle and qt 5.4.0

maitai at virtual-winds.org maitai at virtual-winds.org
Fri Dec 12 08:53:39 CET 2014


So:

I cleaned up my device from all qt related applications, including 
ministro (all through android uninstall), and rebooted it.

I create a new QWidget application, and just added a QPushButton and a 
QSlider (horizontal) in the form. No layout, nothing more. I switched 
the project to "release", ran qmake and rebuild, then deploy it to my 
device without even going to the params or to the manisfest.

I still don't get the correct android-style, I join a screen-shot.

The output in the console is:


Starting remote process.I/SELinux ( 9306): Function: 
selinux_android_load_priority [0], There is no sepolicy file.
I/SELinux ( 9306):
I/SELinux ( 9306): Function: selinux_android_load_priority , spota 
verifySig and checkHash pass. priority version is 
VE=SEPF_GT-I9505_4.4.2_0032
I/SELinux ( 9306):
I/SELinux ( 9306):
I/SELinux ( 9306): selinux_android_seapp_context_reload: seapp_contexts 
file is loaded from /data/security/spota/seapp_contexts
E/dalvikvm( 9306): >>>>> Normal User
E/dalvikvm( 9306): >>>>> org.qtproject.example.testStyle [ userId:0 | 
appId:10007 ]
D/dalvikvm( 9306): Late-enabling CheckJNI
E/MoreInfoHPW_ViewGroup( 9306): Parent view is not a TextView
D/dalvikvm( 9306): Trying to load lib 
/data/data/org.qtproject.example.testStyle/lib/libgnustl_shared.so 
0x42a620d0
D/dalvikvm( 9306): Added shared lib 
/data/data/org.qtproject.example.testStyle/lib/libgnustl_shared.so 
0x42a620d0
D/dalvikvm( 9306): No JNI_OnLoad found in 
/data/data/org.qtproject.example.testStyle/lib/libgnustl_shared.so 
0x42a620d0, skipping init
D/dalvikvm( 9306): Trying to load lib 
/data/data/org.qtproject.example.testStyle/lib/libQt5Core.so 0x42a620d0
D/dalvikvm( 9306): Added shared lib 
/data/data/org.qtproject.example.testStyle/lib/libQt5Core.so 0x42a620d0
D/dalvikvm( 9306): Trying to load lib 
/data/data/org.qtproject.example.testStyle/lib/libQt5Gui.so 0x42a620d0
D/dalvikvm( 9306): Added shared lib 
/data/data/org.qtproject.example.testStyle/lib/libQt5Gui.so 0x42a620d0
D/dalvikvm( 9306): No JNI_OnLoad found in 
/data/data/org.qtproject.example.testStyle/lib/libQt5Gui.so 0x42a620d0, 
skipping init
D/dalvikvm( 9306): Trying to load lib 
/data/data/org.qtproject.example.testStyle/lib/libQt5Widgets.so 
0x42a620d0
D/dalvikvm( 9306): Added shared lib 
/data/data/org.qtproject.example.testStyle/lib/libQt5Widgets.so 
0x42a620d0
D/dalvikvm( 9306): No JNI_OnLoad found in 
/data/data/org.qtproject.example.testStyle/lib/libQt5Widgets.so 
0x42a620d0, skipping init
D/dalvikvm( 9306): Trying to load lib 
/data/data/org.qtproject.example.testStyle/qt-reserved-files/plugins/platforms/android/libqtforandroid.so 
0x42a620d0
D/dalvikvm( 9306): Added shared lib 
/data/data/org.qtproject.example.testStyle/qt-reserved-files/plugins/platforms/android/libqtforandroid.so 
0x42a620d0
I/Qt      ( 9306): qt start
W/System.err( 9306): java.lang.ClassNotFoundException: 
android.graphics.drawable.RippleDrawable
W/System.err( 9306): 	at java.lang.Class.classForName(Native Method)
W/System.err( 9306): 	at java.lang.Class.forName(Class.java:251)
W/System.err( 9306): 	at java.lang.Class.forName(Class.java:216)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.ExtractStyle.getClass(ExtractStyle.java:396)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:100)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:438)
W/System.err( 9306): 	at java.lang.reflect.Method.invokeNative(Native 
Method)
W/System.err( 9306): 	at 
java.lang.reflect.Method.invoke(Method.java:515)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
W/System.err( 9306): 	at 
android.app.Activity.performCreate(Activity.java:5426)
W/System.err( 9306): 	at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
W/System.err( 9306): 	at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269)
W/System.err( 9306): 	at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
W/System.err( 9306): 	at 
android.app.ActivityThread.access$900(ActivityThread.java:161)
W/System.err( 9306): 	at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
W/System.err( 9306): 	at 
android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 9306): 	at android.os.Looper.loop(Looper.java:157)
W/System.err( 9306): 	at 
android.app.ActivityThread.main(ActivityThread.java:5356)
W/System.err( 9306): 	at java.lang.reflect.Method.invokeNative(Native 
Method)
W/System.err( 9306): 	at 
java.lang.reflect.Method.invoke(Method.java:515)
W/System.err( 9306): 	at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
W/System.err( 9306): 	at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
W/System.err( 9306): 	at dalvik.system.NativeStart.main(Native Method)
W/System.err( 9306): Caused by: java.lang.NoClassDefFoundError: 
android/graphics/drawable/RippleDrawable
W/System.err( 9306): 	... 25 more
W/System.err( 9306): Caused by: java.lang.ClassNotFoundException: Didn't 
find class "android.graphics.drawable.RippleDrawable" on path: 
DexPathList[[zip file 
"/data/app/org.qtproject.example.testStyle-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.qtproject.example.testStyle-1, 
/vendor/lib, /system/lib]]
W/System.err( 9306): 	at 
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
W/System.err( 9306): 	at 
java.lang.ClassLoader.loadClass(ClassLoader.java:497)
W/System.err( 9306): 	at 
java.lang.ClassLoader.loadClass(ClassLoader.java:457)
W/System.err( 9306): 	... 25 more
W/System.err( 9306): java.lang.ClassNotFoundException: 
android.graphics.drawable.AnimatedStateListDrawable
W/System.err( 9306): 	at java.lang.Class.classForName(Native Method)
W/System.err( 9306): 	at java.lang.Class.forName(Class.java:251)
W/System.err( 9306): 	at java.lang.Class.forName(Class.java:216)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.ExtractStyle.getClass(ExtractStyle.java:396)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:101)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:438)
W/System.err( 9306): 	at java.lang.reflect.Method.invokeNative(Native 
Method)
W/System.err( 9306): 	at 
java.lang.reflect.Method.invoke(Method.java:515)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
W/System.err( 9306): 	at 
android.app.Activity.performCreate(Activity.java:5426)
W/System.err( 9306): 	at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
W/System.err( 9306): 	at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269)
W/System.err( 9306): 	at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
W/System.err( 9306): 	at 
android.app.ActivityThread.access$900(ActivityThread.java:161)
W/System.err( 9306): 	at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
W/System.err( 9306): 	at 
android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 9306): 	at android.os.Looper.loop(Looper.java:157)
W/System.err( 9306): 	at 
android.app.ActivityThread.main(ActivityThread.java:5356)
W/System.err( 9306): 	at java.lang.reflect.Method.invokeNative(Native 
Method)
W/System.err( 9306): 	at 
java.lang.reflect.Method.invoke(Method.java:515)
W/System.err( 9306): 	at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
W/System.err( 9306): 	at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
W/System.err( 9306): 	at dalvik.system.NativeStart.main(Native Method)
W/System.err( 9306): Caused by: java.lang.NoClassDefFoundError: 
android/graphics/drawable/AnimatedStateListDrawable
W/System.err( 9306): 	... 25 more
W/System.err( 9306): Caused by: java.lang.ClassNotFoundException: Didn't 
find class "android.graphics.drawable.AnimatedStateListDrawable" on 
path: DexPathList[[zip file 
"/data/app/org.qtproject.example.testStyle-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.qtproject.example.testStyle-1, 
/vendor/lib, /system/lib]]
W/System.err( 9306): 	at 
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
W/System.err( 9306): 	at 
java.lang.ClassLoader.loadClass(ClassLoader.java:497)
W/System.err( 9306): 	at 
java.lang.ClassLoader.loadClass(ClassLoader.java:457)
W/System.err( 9306): 	... 25 more
W/System.err( 9306): java.lang.ClassNotFoundException: 
android.graphics.drawable.VectorDrawable
W/System.err( 9306): 	at java.lang.Class.classForName(Native Method)
W/System.err( 9306): 	at java.lang.Class.forName(Class.java:251)
W/System.err( 9306): 	at java.lang.Class.forName(Class.java:216)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.ExtractStyle.getClass(ExtractStyle.java:396)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:102)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:438)
W/System.err( 9306): 	at java.lang.reflect.Method.invokeNative(Native 
Method)
W/System.err( 9306): 	at 
java.lang.reflect.Method.invoke(Method.java:515)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
W/System.err( 9306): 	at 
org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
W/System.err( 9306): 	at 
android.app.Activity.performCreate(Activity.java:5426)
W/System.err( 9306): 	at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
W/System.err( 9306): 	at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269)
W/System.err( 9306): 	at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
W/System.err( 9306): 	at 
android.app.ActivityThread.access$900(ActivityThread.java:161)
W/System.err( 9306): 	at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
W/System.err( 9306): 	at 
android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 9306): 	at android.os.Looper.loop(Looper.java:157)
W/System.err( 9306): 	at 
android.app.ActivityThread.main(ActivityThread.java:5356)
W/System.err( 9306): 	at java.lang.reflect.Method.invokeNative(Native 
Method)
W/System.err( 9306): 	at 
java.lang.reflect.Method.invoke(Method.java:515)
W/System.err( 9306): 	at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
W/System.err( 9306): 	at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
W/System.err( 9306): 	at dalvik.system.NativeStart.main(Native Method)
W/System.err( 9306): Caused by: java.lang.NoClassDefFoundError: 
android/graphics/drawable/VectorDrawable
W/System.err( 9306): 	... 25 more
W/System.err( 9306): Caused by: java.lang.ClassNotFoundException: Didn't 
find class "android.graphics.drawable.VectorDrawable" on path: 
DexPathList[[zip file 
"/data/app/org.qtproject.example.testStyle-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.qtproject.example.testStyle-1, 
/vendor/lib, /system/lib]]
W/System.err( 9306): 	at 
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
W/System.err( 9306): 	at 
java.lang.ClassLoader.loadClass(ClassLoader.java:497)
W/System.err( 9306): 	at 
java.lang.ClassLoader.loadClass(ClassLoader.java:457)
W/System.err( 9306): 	... 25 more
W/ResourceType( 9306): Skipping entry 0x1080ade in package table 0 
because it is not complex!
D/dalvikvm( 9306): GC_CONCURRENT freed 3467K, 18% free 21835K/26536K, 
paused 4ms+2ms, total 27ms
D/dalvikvm( 9306): GC_CONCURRENT freed 2131K, 19% free 21751K/26536K, 
paused 5ms+2ms, total 24ms
D/dalvikvm( 9306): WAIT_FOR_CONCURRENT_GC blocked 10ms
D/dalvikvm( 9306): GC_FOR_ALLOC freed 387K, 18% free 21925K/26536K, 
paused 14ms, total 14ms
I/dalvikvm-heap( 9306): Grow heap (frag case) to 24.580MB for 82960-byte 
allocation
D/dalvikvm( 9306): GC_FOR_ALLOC freed 426K, 16% free 22703K/27012K, 
paused 15ms, total 15ms
D/dalvikvm( 9306): Trying to load lib 
/data/app-lib/org.qtproject.example.testStyle-1/libtestStyle.so 
0x42a620d0
D/dalvikvm( 9306): Added shared lib 
/data/app-lib/org.qtproject.example.testStyle-1/libtestStyle.so 
0x42a620d0
D/dalvikvm( 9306): No JNI_OnLoad found in 
/data/app-lib/org.qtproject.example.testStyle-1/libtestStyle.so 
0x42a620d0, skipping init
I/Adreno-EGL( 9306): <qeglDrvAPI_eglInitialize:381>: EGL 1.4 QUALCOMM 
build:  (CL3869936)
I/Adreno-EGL( 9306): OpenGL ES Shader Compiler Version: 17.01.11.SPL
I/Adreno-EGL( 9306): Build Date: 01/17/14 Fri
I/Adreno-EGL( 9306): Local Branch:
I/Adreno-EGL( 9306): Remote Branch:
I/Adreno-EGL( 9306): Local Patches:
I/Adreno-EGL( 9306): Reconstruct Branch:
D/OpenGLRenderer( 9306): Enabling debug mode 0
D/Qt      ( 9306): (null):0 ((null)): FT_New_Face failed with index 0 : 
90

Thanks for helping me with this issue.
Philippe Lelong


Le 11-12-2014 20:41, maitai at virtual-winds.org a écrit :
> Thanks for your reply,
> 
> I have tried many sample projects from qt just to be sure it doesn't
> come from mine. For instance Examples/Qt-5.4/widgets/widgets/sliders
> just looks bad (compiled and run out of the box without any change). I
> have uninstall ministro just to make sure it does not interfere, no
> luck. Also tried various android API targets, from 19 to 21, and many
> other desperate ideas...
> 
> I will try again tomorrow with a brand new app with just a QPushButton
> and a clean device concerning ministro.
> 
> I'm using Android for armeabi-v7a (GCC 4.8, Qt 5.4.0)/Samsung Galaxy
> S4/Android 4.4.2
> 
> At least it's good to know it should work :)
> 
> Philippe.
> 
> Le 11-12-2014 20:06, Nurmi J-P a écrit :
>>> On 11 Dec 2014, at 19:48, maitai at virtual-winds.org wrote:
>>> 
>>> All my hopes were based on this announcement:
>>> 
>>> http://blog.qt.digia.com/blog/2014/12/03/native-android-style-in-qt-5-4/
>>> 
>>> Where you can read:
>>> 
>>> In other words, Qt Widgets applications will look native regardless 
>>> of the deployment method; system wide or bundled Qt libraries.
>>> 
>>> 
>>> 
>>> Le 11-12-2014 19:42, Harri Pasanen a écrit :
>>> 
>>>> I too get in startup lots of them ClassNotFoundExceptions related to 
>>>> styling.
>>>> I think those can be ignored, even if they are a bit annoying.
>>>> 
>>>> Qt 5.4 announcement only talks about native styling for Qt Quick 
>>>> controls, I suppose you are looking for something more?
>>>> 
>>>> Harri
>>>> 
>>>> On 11/12/2014 19:18, maitai at virtual-winds.org wrote:
>>>>> Still struggling with this... I tried to remove ministro, to set 
>>>>> some
>>>>> variable, to change the style in the manifest, and many other 
>>>>> things :(
>>>>> 
>>>>> I always get this in the console, and I suppose it's dead:
>>>>> 
>>>>> W/System.err( 8785): java.lang.ClassNotFoundException:
>>>>> android.graphics.drawable.RippleDrawable
>>>>> W/System.err( 8785): 	at java.lang.Class.classForName(Native 
>>>>> Method)
>>>>> W/System.err( 8785): 	at java.lang.Class.forName(Class.java:251)
>>>>> W/System.err( 8785): 	at java.lang.Class.forName(Class.java:216)
>>>>> W/System.err( 8785): 	at
>>>>> org.qtproject.qt5.android.ExtractStyle.getClass(ExtractStyle.java:396)
>>>>> W/System.err( 8785): 	at
>>>>> org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:100)
>>>>> W/System.err( 8785): 	at
>>>>> org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:438)
>>>>> 
>>>>> and many more lines...
>>>>> 
>>>>> Switching back to 5.3.2...
>>>>> 
>>>>> Thanks anyway
>>>>> Philippe.
>>>>> 
>>>>> 
>>>>> 
>>>>> Le 11-12-2014 14:46, maitai at virtual-winds.org a écrit :
>>>>> 
>>>>> Still puzzled on that one... Tried some qt examples, also no 
>>>>> android-styled widget there... Am I missing something obvious? I 
>>>>> had qandroidstyle more or less ok in 5.3.2 through ministro, I 
>>>>> thought that would be incorporated in 5.4 even without Ministro.
>>>>> 
>>>>> Quote from qt-blog:
>>>>> 
>>>>> 
>>>>> In Qt 5.4, selected parts of Ministro source code have been 
>>>>> incorporated into the Android platform plugin of Qt. This makes it 
>>>>> possible for Qt applications to look native without Ministro, even 
>>>>> though applications wishing to use services provided by Ministro 
>>>>> will continue to do so. In other words, Qt Widgets applications 
>>>>> will look native regardless of the deployment method; system wide 
>>>>> or bundled Qt libraries.
>>>>> 
>>>>> 
>>>>> Any help welcomed :)
>>>>> 
>>>>> Le 10-12-2014 20:08,
>>>>> maitai at virtual-winds.org
>>>>>  a écrit :
>>>>> > Hello,
>>>>> >
>>>>> > I just installed and tried qt5.4 for android. I thought that
>>>>> > QAndroidStyle (through QStyleFactory) would become available even if the
>>>>> > application is not deployed with ministro, as read here:
>>>>> >
>>>>> >
>>>>> http://blog.qt.digia.com/blog/2014/12/03/native-android-style-in-qt-5-4/
>>>>> 
>>>>> >
>>>>> > But there is no "android" style available in QStyleFactory and our app
>>>>> > (QWidget based) just looks ugly... I tried fusion and also not to load
>>>>> > any style, same mess.
>>>>> >
>>>>> > Is there something I should do/call to make androidstyle available in
>>>>> > 5.4 without ministro?
>>>>> >
>> 
>> Hi,
>> 
>> I'm using Qt 5.4.0, Qt Creator 3.3.0, and Nexus 5. If I create a "Qt
>> Widgets Application" in Qt Creator, throw in a QPushButton on the
>> form, and run the app, it uses the Android style. I didn't touch the
>> default deployment method which is "Bundle Qt libraries in APK" by
>> default, and I don't actually even have Ministro installed. I don't
>> know what goes wrong with your app (tried uninstalling the app?) but
>> I'd encourage to try such minimal test case first. It takes 10s to
>> create the minimal app and it provides a nice clean plate. If that
>> doesn't work, then we might have a bigger problem. I hope this is just
>> some weirdness related to switching between the deployment methods
>> and/or having old style extraction data around.
>> 
>> PS. The exceptions are unfortunate but harmless noise.
>> 
>> --
>> J-P Nurmi
>> 
>> _______________________________________________
>> Android-development mailing list
>> Android-development at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/android-development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot_2014-12-12-08-39-01.png
Type: image/png
Size: 25115 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20141212/22eac991/attachment.png>


More information about the Android-development mailing list