Android: Update Android Stidio jdk detection

Fixes: QTCREATORBUG-28866
Fixes: QTCREATORBUG-30322
Change-Id: Id7908301a6c6acb540e6a7d575cc6b8b95cdf5d6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Artem Sokolovskii
2024-02-08 10:29:35 +01:00
parent 291a893f5f
commit 0afe354952

View File

@@ -1479,9 +1479,12 @@ FilePath AndroidConfig::getJdkPath()
// Look for Android Studio's jdk first
const FilePath androidStudioSdkPath = androidStudioPath();
if (!androidStudioSdkPath.isEmpty()) {
const FilePath androidStudioSdkJrePath = androidStudioSdkPath / "jre";
if (androidStudioSdkJrePath.exists())
jdkHome = androidStudioSdkJrePath;
const QStringList allVersions{"jbr", "jre"};
for (const QString &version : allVersions) {
const FilePath androidStudioSdkJbrPath = androidStudioSdkPath / version;
if (androidStudioSdkJbrPath.exists())
return androidStudioSdkJbrPath;
}
}
if (jdkHome.isEmpty()) {