Android crashes on compiling



  • Hello i am very new to Android with QT and just configured everything and tried to compile... i use a emulator and it always crashes on 3rth bild step
    i tried android for x86
    android for armeabi v-7a
    android for armeabi
    kit´s and on 5 different diveces. Some devices render but the qt creator crashes and nothing happens, some just dont even get created.

    I get following output:

    http://pastebin.com/FDyB3eJF

    Any suggestions?

    Furthemore it somehow does not recognize x86 devices with x86 toolkit as compatible anymore for some reason, the run before it recognized it right...

    Edit:
    I just saw that i have some build directorys which seem to compile successfull but if i execute the .bat i see the emulation of the smartphone, but nothing happens. It´s in Loadscreen all the time und does not load the programm.



  • about Emulation: I don't know why but in latests SDK emulators don't work correct.
    Some ones tell that just emulator so slowly works.

    To solve the problem I'm use virtual box by Oracle and image for x86 arch of Android. Works fine



  • Ok think its a emulator problem, i connected it to my phone and it works but the result ist pretty destructive, the margins and height and length of the elements are destroyed, colours of message boxes change, strange layout and so on...

    any suggestions? :D



  • You build project first for other platform (e.g. Windows). Isn't it?
    And then porting for Android.

    Look: take up some widget, for example QPushButton.
    It has default size 140 x 25 and you got used to that, how it looks on your monitor with resolution for example 1600 x 900.

    But on Androif device resolution is lower, sixe of QPushButton stays the same.
    It's look not beautifully.

    You just must to dynamic solve the comfortable sizes for your widgets elements in code depending on screen resolution or set the sizes beforehand according device you use.

    Color and layout - it's other cases. They defines by Android native style, as I understand. I don't made him out deeply.



  • If your porting your application on Mac it don't look the same on Windows etc. And on Linux appearance will be another too



  • W/System.err(13605): java.lang.ClassNotFoundException: android.graphics.drawable.RippleDrawable
    W/System.err(13605): at java.lang.Class.classForName(Native Method)
    W/System.err(13605): at java.lang.Class.forName(Class.java:217)
    W/System.err(13605): at java.lang.Class.forName(Class.java:172)
    W/System.err(13605): at org.qtproject.qt5.android.ExtractStyle.getClass(ExtractStyle.java:396)
    W/System.err(13605): at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:100)
    W/System.err(13605): at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:438)
    W/System.err(13605): at java.lang.reflect.Method.invokeNative(Native Method)

    These are some errors i get in the output console while my application is runnung, i am now trying to run a official example (the calculator), everything wents well except the texts overlap on the display side...

    can it be caused by my android phone ? (Android 4.0.3)



  • look in project setup for such version of android you build project.
    And what api's of android is installed (android sdk)
    And in system variable 'path' all correct?



  • [quote author="Subst27" date="1421122720"]You build project first for other platform (e.g. Windows). Isn't it?
    And then porting for Android.

    Look: take up some widget, for example QPushButton.
    It has default size 140 x 25 and you got used to that, how it looks on your monitor with resolution for example 1600 x 900.

    But on Androif device resolution is lower, sixe of QPushButton stays the same.
    It's look not beautifully.[/quote]

    The resolution of most android devices can hold up with monitors. The problem here is the pixel density. In the most cases the pixel density of a smartphone is higher than on a montitor. If you develop on a FullHD monitor and deploy on a FullHD smartphone, the pixel-size shouldn't change, still it might look not native or 'good' because the smartphone has got a higher pixel-density and therefore the real/physical size of the button is smaller.



  • To onek24:

    perhaps u are right, I don't investigated this problem profoundly



  • [quote author="Subst27" date="1421163595"]To onek24:

    perhaps u are right, I don't investigated this problem profoundly [/quote]

    Well, this was my experience when i worked with QtQuck apps for android. Thats why i like the working with inches/cm for mobile devices, using this will keep the physical size of the objects constant, no mater what resolution you are using. 7" hd will be the same as 7" full-hd or 7" 4k, the only thing that changes is the sharpness.



  • thanks
    it's useful information

    I don't write for android right now. I'm only build functionality toolchain for it and build some tests apps. but in few time may be will be needed to creating full-function application.



  • [quote author="Subst27" date="1421166886"]thanks
    it's useful information

    I don't write for android right now. I'm only build functionality toolchain for it and build some tests apps. but in few time may be will be needed to creating full-function application.[/quote]

    You're very welcome.

    I've got two links which you might want to check out:

    "Screen QML Type":http://doc.qt.io/qt-5/qml-qtquick-window-screen.html
    "QScreen Class":http://doc.qt.io/qt-5/qscreen.html

    These two classes are providing you a bunch of informations about the screen including the pixelDensity.



  • It's well known for me :)


Log in to reply
 

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