Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.0 Beta4
-
None
-
-
2025Season1QtforAndroid, 2024wk52FOQtforAndroid
Description
We have some Java sources in our project, which our developers prefer to edit in Android Studio. While it’s possible to open the Android package source (/android subfolder) of any Qt project in Android Studio, getting the Android project outline, proper syntax highlighting, and other benefits like this requires Android Studio to be able to compile the Gradle project.
The default build.gradle file from the Qt templates contain various variables that are only set when building with Qt, which causes Gradle to throw the following error in Android Studio:
A problem occurred evaluating root project 'android'. > Could not get unknown property 'qtGradlePluginType' for root project 'android' of type org.gradle.api.Project.
In the past we were able to work around this by checking whether these variables are available like this:
android { if (project.hasProperty('qtAndroidDir')) { // building with Qt namespace androidPackageName ... } else { // building with Android Studio namespace "com.example.app" ... } }
However this has been breaking in different ways due to various changes in recent Qt releases (6.7 and 6.8) due to differences in how androiddeployqt and Qt Creator parse this file in order to find the active namespace.
It would be helpful if this would be officially supported with the default templates.
Attachments
Issue Links
- mentioned in
-
Page Loading...