Building Qt for Android



  • I'm trying to build Qt for Android on a linux system (Debian unstable). I'm following the procedure at http://qt-project.org/wiki/Qt5ForAndroidBuilding

    I got a fresh git clone, configured, ran make and got the base g++ build completed. Then when the build got to the java at qt5/qtbase/src/android/jar, it halted with the error
    @javac: invalid source release: 6@

    and I've got no further.

    My current javac is 1.6.0_27 (openjdk-6-jdk), with JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64/
    exported and placed at the front of my path. (I also got the same failure with the 1.7.0_25 javac from openjdk-7-jdk)

    The make output is:

    bq.
    make[3]: Entering directory /home/projects/android-qt/qt5/qtbase/src/android' cd jar/ && ( test -e Makefile || /home/projects/android-qt/qt5/qtbase/bin/qmake /home/projects/android-qt/qt5/qtbase/src/android/jar/jar.pro -o Makefile ) && make -f Makefile make[4]: Entering directory/home/projects/android-qt/qt5/qtbase/src/android/jar'
    ( test -e Makefile.bundledjar || /home/projects/android-qt/qt5/qtbase/bin/qmake /home/projects/android-qt/qt5/qtbase/src/android/jar/bundledjar.pro -o Makefile.bundledjar ) && make -f Makefile.bundledjar
    make[5]: Entering directory `/home/projects/android-qt/qt5/qtbase/src/android/jar'
    javac -source 6 -target 6 -cp /home/projects/android-qt/qt5/qtbase/src/android/jar/src/:/home/projects/android-qt/adt-bundle-linux-x86_64-20130917/sdk//platforms/android-10/android.jar -d .classes.bundled src/org/qtproject/qt5/android/QtActivityDelegate.java src/org/qtproject/qt5/android/QtEditText.java src/org/qtproject/qt5/android/QtInputConnection.java src/org/qtproject/qt5/android/QtLayout.java src/org/qtproject/qt5/android/QtNative.java src/org/qtproject/qt5/android/QtNativeLibrariesDir.java src/org/qtproject/qt5/android/QtSurface.java
    javac: invalid source release: 6

    No permutation of javac -source 6 or 7 or 1.6 or 1.7 seemed to help.

    I got the same error with both current git (Qt 5.2 alpha) and the v5.1.1 tag. Likewise with both the current google ndk-r9 (gcc 4.8) and the Qt special build of ndk-r8e (gcc 4.7) listed at http://qt-project.org/wiki/Qt5ForAndroidBuilding (the different ndks made a small difference* to the g++ build, but no difference to this javac error). I only tried the one sdk from adt-bundle-linux-x86_64-20130917.

    Hope you can help!

    . * with ndk-r8e (gcc 4.7) on current git, there were the g++ errors discussed at http://stackoverflow.com/questions/19152204/cc1plus-error-werror-literal-suffix-no-option-wliteral-suffix
    No such error with ndk-r9 on Qt tag v5.1.1.



  • I've sorted the -source error. javac 1.6 does not recognise "-source 6" (6 is not a valid value for that version of java).

    The jdk needs to be 7 (java 1.7) for "-source 6" to be recognised.


Log in to reply
 

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