diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index f4c96edc55d..c91f9297005 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -3705,6 +3705,14 @@ int generateJavaQmlComponents(const Options &options) const QString moduleClassname = moduleInfo.moduleName[0].toUpper() + moduleInfo.moduleName.last(moduleInfo.moduleName.size() - 1); + if (moduleInfo.moduleName == libName) { + fprintf(stderr, + "A QML module name (%s) cannot be the same as the target name when building " + "with QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS flag.\n", + qPrintable(moduleInfo.moduleName)); + return false; + } + int indentBase = 4; if (leafEqualsLibname) { indentBase = 0;