Conversation
| subprojects { | ||
| afterEvaluate { project -> | ||
| if (project.hasProperty('android')) { | ||
| project.android { | ||
| if (namespace == null) { | ||
| namespace project.group | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Yes, I added this snippet because the twitter_login package(i.e a dependency of the main project) uses an outdated Android Gradle Plugin (AGP version 4.1.0), which was causing compatibility issues with the main project that uses AGP 8.1.0. Specifically, the error Namespace not specified. Specify a namespace in the module's build file was occurring.
After some investigation, I found that earlier AGP versions (before 8.x.x) derived the namespace from the AndroidManifest.xml file, while AGP 8.x.x and above require the namespace to be explicitly defined in the module's build.gradle file. Since twitter_login is still on AGP 4.1.0, its namespace property in the build.gradle file was being ignored, leading to the error.
To address this, I added the quoted snippet. It ensures that for any subproject using the Android plugin (project.hasProperty('android')), the namespace is dynamically set to the project’s group property if it’s not already defined(or ignored) in the build.gradle file of the module.
Once the twitter_login package updates its AGP version to 8.x.x or later, this workaround will likely no longer be necessary. There's already an active issue requesting for AGP version upgrade: 0maru/twitter_login#140
|
I guess this merge request can be merged, does not it? |
Risk Level
Pre-submit checklist