0

I have worked on a flutter project in 2023. I was facing errors with gradle settings. I managed to migrate the gradle settings following the official Flutter documentation(https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply). Now, I am facing another error, highlighted in the attached screenshot. I have specified the namespace as per official documentation(https://developer.android.com/build/configure-app-module#groovy). Is there a way around to fix it?enter image description here

1 Answer 1

1

Apparently this is a known issue, this issue occurred in older versions of flutter due to outdated or deprecated packages.

Possible resolution:

add the script to android/build.gradle or android/build.gradle.kts:

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

If these changes do not solve your problem, read this problem here carefully, I think it will solve your problem.

Sign up to request clarification or add additional context in comments.

1 Comment

This worked for me, thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.