Skip to content

AGP Upgrade Assistant • Build Failure #58

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

Open
Azzeccagarbugli opened this issue Oct 11, 2024 · 6 comments
Open

AGP Upgrade Assistant • Build Failure #58

Azzeccagarbugli opened this issue Oct 11, 2024 · 6 comments

Comments

@Azzeccagarbugli
Copy link

Azzeccagarbugli commented Oct 11, 2024

Hello @jiusanzhou,

On the latest version of the package I'm getting the following error:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':flutter_notification_listener'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

     If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

This is the output of flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.5 23F79 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.94.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

I also tried to fork the repo and fix the issue using the official documentation provided by the Android Studio guidelines but without success.

Thanks a lot for your time ✨

@handika231
Copy link

Same issue

@echo-LuGuang
Copy link

+1

1 similar comment
@akhilgorantala
Copy link

+1

@akhilgorantala
Copy link

@Azzeccagarbugli @echo-LuGuang downgrade flutter version.

@shoyabsiddique0
Copy link

is there any other thing i can do apart from downgrading to solve this issue?

@Matsuo32
Copy link

Matsuo32 commented Dec 1, 2024

// add this
subprojects {
        afterEvaluate { project ->
            if (project.hasProperty('android')) {
                project.android {
                    if (namespace == null) {
                        namespace project.group
                    }
                }
            }
        }
}
subprojects {
    project.evaluationDependsOn(':app')
}

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

6 participants