Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Android: Build failed with exception. Could not determine Java version from '11.0.10'



  • Hello everyone, I have a Qt project that is successfully deployed to Windows. I have been trying to get it to build for Android but have not found any success (tried everything I could find online).

    124288d6-c0c2-4080-a16a-659ab497c363-image.png
    ce43ed7c-143c-468b-b84a-217044ff3f03-image.png

    I have used Qt to download the SDK and OpenSSL. I have tried the official releases of Java: 11.0.10 and 8u281 as well as AdoptOpenJDK 8.0.282.8 and 11.0.10.9

    Any tips would be greatly appreciated as I have exhausted all of the resources I could find online.

    P.S. In case it is worth mentioning, I have all of the assets installed for Android 11 and Android 10 under the SDK tab in devices.



  • Kit setting for the devices seems to be fine, check with project settings.
    rebuild the project and check it. What log is displaying in "compile output" window?



  • Thanks for the feedback! This is the compile output.

    e18ae461-3954-4139-bc76-1259d446f1c7-image.png

    Anything specific to check in the project settings?



  • @SGaist have you experienced this before? Any feedback would be greatly, greatly appreciated!


  • Lifetime Qt Champion

    Hi,

    There was an issue in previous versions of Qt Creator with the Java version check that was a bit too restrictive but I think it has been fixed in between.

    Which version are you running ?



  • @SGaist thanks for the reply! Qt 5.15.2
    3c2d93a3-419d-42c7-a199-be0df3ea4c78-image.png



  • Anything above Java 8 isn't supported by Android atm.



  • @morte thanks for the reply!

    I have tried the official releases of Java: 11.0.10 and 8u281 as well as AdoptOpenJDK 8.0.282.8 and 11.0.10.9

    Think I need to downgrade even further?



  • It works with AdoptOpenJDK 8.0.282.8, should also work with other Java 7/8 JDKs.
    What is build output with Java 8?



  • @morte
    83670187-6fa1-4f9e-8f4f-ad7fd9e9e579-image.png

    Thank you for the help!



  • Maybe something wrong with 'Compilers', it sometimes become broken after replacing JDK and Android SDK, NDK.

    Working configuration looks something like that (don't mind NDK version on screenshot - 21.4, it also works with 21.3):
    options-compilers.png

    If problem with 'Compilers' and Re-detcting won't help, if you don't have any valuable settings, you can delete whole Qt Creator settings, located at C:\Users%USERNAME%\AppData\Roaming\QtProject or only "toolchains.xml" file. Qt Creator recreates those on startup.


Log in to reply