Skip to content

Commit

Permalink
Add warning for Flutter plugins with missing namespaces
Browse files Browse the repository at this point in the history
- Apply changes to resource linking work around as well.
  • Loading branch information
erdemyerebasmaz committed Jan 6, 2025
1 parent 9b13dd7 commit 5024114
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ subprojects {
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
project.logger.error(
"Warning: 'namespace' property for Flutter plugin '${project.name}' is not defined."
+ " Setting the 'namespace' property to '${project.group}' as a fallback."
+ "\nWith AGP 8.+, the 'namespace' property must be explicitly defined in the module-level build script."
+ "\nIf a new version of '${project.name}' is not available, consider filing an issue against '${project.name}'"
+ " to add 'namespace' property on their module-level build script (otherwise try updating to the latest version)."
)
namespace project.group
}
}
Expand All @@ -19,13 +26,10 @@ subprojects {
Integer pluginCompileSdk = project.android.compileSdk
if ((project.plugins.hasPlugin("com.android.application") || project.plugins.hasPlugin("com.android.library")) && pluginCompileSdk != null && pluginCompileSdk < 31) {
project.logger.error(
"Warning: Overriding compileSdkVersion version in Flutter plugin: "
+ project.name
+ " from "
"Warning: Overriding 'compileSdkVersion' version on Flutter plugin '${project.name}' from "
+ pluginCompileSdk
+ " to 35 (to work around https://issuetracker.google.com/issues/199180389)."
+ "\nIf there is not a new version of " + project.name + ", consider filing an issue against "
+ project.name
+ "\nIf a new version of '${project.name}' is not available, consider filing an issue against '${project.name}'"
+ " to increase their compileSdkVersion to the latest (otherwise try updating to the latest version)."
)
project.android {
Expand Down

0 comments on commit 5024114

Please sign in to comment.