Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.15.14
-
None
Description
I'm in the process of upgrading the Gradle version in our Qt Android project from Gradle 4.1.0 to 7.4.1. This newer version of Gradle deprecates the use of a 'package' attribute in the 'manifest' element of the AndroidManifest.xml file. We have this in our AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?> <manifest package="com.trimble.access" ...etc>
When I build the project, Gradle reports a warning about 'package' being deprecated:
package="com.trimble.access" found in source AndroidManifest.xml: C:\dev\access\Survey\Android-ARM64-Release\android-build\AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
I tried doing exactly what this warning suggested - removing the 'package' attribute from the manifest, and adding a 'namespace' setting in the build.gradle file:
android {
namespace = "com.trimble.access"
...etc
}
But now the build fails entirely, as androiddeployqt reports a fatal error:
Invalid android manifest file: C:/dev/Android-ARM64-Release/android-build/AndroidManifest.xml
I found the source code for androiddeployqt on code.qt.io, and it's clear that it's going to unconditionally fail with this error if the 'package' attribute is not present:
if (!reader.attributes().hasAttribute("package"_L1)) { fprintf(stderr, "Invalid android manifest file: %s\n", qPrintable(androidManifestPath)); return false; }
Now that the 'package' attribute is not only optional, but deprecated, this check no longer makes sense.
Attachments
Issue Links
- duplicates
-
QTBUG-106907 "package" attribute in AndroidManifest is deprecated
- Closed