1
votes

I followed step by step the very nice Digia example to run Qt/QML on Android.

When I click [build] from IDE-Qt, the output looks nice:

Running steps for project bubble...
Configuration unchanged, skipping qmake step.
Starting: "/usr/bin/make" 
make: Nothing to be done for `first'.
The process "/usr/bin/make" exited normally.
Elapsed time: 00:00.

[Run QMake]

Running steps for project bubble...
Starting: "/.../qt5/creator/Qt5.1.1/5.1.1/gcc_64/bin/qmake" /~/Desktop/bubble/bubble.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
The process "/.../qt5/creator/Qt5.1.1/5.1.1/gcc_64/bin/qmake" exited normally.

[Run]

QML debugging is enabled. Only use this in a safe environment.
QQmlApplicationEngine failed to load component 
qrc:///bubble.qml:38 Cannot assign to non-existent property "onReadingChanged"

I also read that qmlviewer is not more in use on Qt5: No qmlviewer installed .

Android SDK NDK is installed, and the device is enabled and on developer mode, and as the error message only complains about QML, I guess it shouldn't be the reason for the App not be running.

All suggestions are welcome.

1

1 Answers

3
votes

Your sensor was not properly set/activated. Try this:

OrientationSensor {
 id: orientation
 active: true

 onReadingChanged: {

     if (reading.orientation == OrientationReading.FaceUp)
         content.state = "FaceUp";

     // ... more tests for different orientations ...
 }
}

For further info, get a look in QtMobility.