Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
Qt Creator 9.0.1
-
None
Description
On Android, there are 2 places to specify the application package:
- build.gradle - defines the unique package ID of the APK
- AndroidManifest.xml - defines the "base" package name for relative class names in the manifest, e.g. for specifying <activity android:name=".MainActivity />
These two are not necessarily the same.
When installing and running the app, Qt Creator tries to start the app by the ID defined in manifest.
Instead, it should use the one from build.gradle.
When changing the ID in build.gradle but not in Manifest (because you probably won't move all your Java sources), build & run fails:
Activity Manager threw the error: Error type 3
Error: Activity class {custom.android.packagename/org.qtproject.qt.android.bindings.QtActivity} does not exist.
(because the wrong app ID is used).
Test project attached. Build and Run with Qt 6.4.1 Android fails.
—
Since the applicationId in build.gradle can be dynamic (e.g. set via gradle.properties), I would suggest checking the built APK file for the application ID and using that one.