Skip to content Skip to sidebar Skip to footer

Error While Building Qt Project For Android

I downloaded Qt Creator 3.3.0 Based on Qt 5.4.0 on Windows. Also jdk1.8.0_25, SDK (all updated), NDK-r10d, apache-ant-1.9.4. Set all necessary configurations. But when I try to bui

Solution 1:

Since Qt 5.4 along with QtCreator 3.3.0 you should go to Projects > Build Android APK > Details for configuring deployment settings. Select an Android API version for Android Build SDK option. Also to create an APK package, select the Bundle Qt libraries in APK option :

enter image description here

You can also select Create Templates to create the manifest file to set application settings like icon, name, ...

Solution 2:

I reinstalled JDK and now everything works. I don't know definitely, but I think the problem had been obtained after update JDK from 1.8.0_25 to 1.8.0_31. The folder with previous version for some reason still was there. It was like:

..\Java\jdk1.8.0_25

..\Java\jdk1.8.0_31

And Qt refered to the jdk1.8.0_25 which already was obsolete.

Solution 3:

What helped me - switch off antivirus. Why? See below:

I've got the same error and re-installation didn't help.

Running manually android.bat list targets from cmd gives the proper list of targets.

After digging into QtCreator code, I found the reason - magic code for get list of targets in qt:

void AndroidConfig::updateAvailableSdkPlatforms() const
{
    QProcess proc;
    proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
    proc.start(androidToolPath().toString(), QStringList() << QLatin1String("list") << QLatin1String("target")); // list avaialbe AVDs
    if (!proc.waitForFinished(10000)) {
        proc.terminate();
        return;
    }
}

As you can see if android.bat list target cmd will not finish for 10 seconds, qtcreator will just terminate the process.

In my case it was 15 secs befor it finishes due to antivirus checks - so switching off antivirus could help in your case.

No need to restart QtCreator. Just open Android section in options again and all targets should be loaded.

I 'love' Qt - it is always like this with it.

Post a Comment for "Error While Building Qt Project For Android"