Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace not specified in build.gradle causing build failure after AGP upgrade to 8.1.0 #49

Open
AzharKV opened this issue Sep 16, 2024 · 3 comments

Comments

@AzharKV
Copy link

AzharKV commented Sep 16, 2024

After upgrading the Android Gradle Plugin (AGP) to version 8.1.0 and Gradle to version 8.0.2, the build fails with an error indicating that a namespace is not specified in the module’s build.gradle file. This issue seems to be a result of recent changes in AGP requiring explicit namespace definitions.

Steps to Reproduce:

Upgrade AGP to version 8.1.0 and Gradle to version 8.0.2 in the build.gradle files.
Attempt to build the project.
Observe the build error related to the namespace.

The issue appeared after updating from AGP version 7.4.2 to 8.1.0 and Gradle from 7.6.3 to 8.0.2. It would be beneficial if the webengage_flutter package could include the required namespace in its build.gradle file to ensure compatibility with these newer versions of the Android Gradle Plugin.

Fluter version: 3.22.3

Screenshot 2024-09-16 at 11 18 29 AM
@srinivasa-b
Copy link

@AzharKV have you found a work around for this?

@MilindWebEngage
Copy link
Collaborator

@srinivasa-b
For now please add the following lines to the android/build.gradle file before the subprojects section of project.evaluationDependsOn(':app'):

subprojects {
    afterEvaluate { project ->
        if (project.hasProperty('android')) {
            project.android {
                if (namespace == null) {
                    namespace = project.group
                }
            }
        }
    }
}

@srinivasa-b
Copy link

@AzharKV Awesome it worked!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants