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 #177

Open
vanhaksreng opened this issue Oct 7, 2024 · 8 comments
Open

Namespace not specified #177

vanhaksreng opened this issue Oct 7, 2024 · 8 comments

Comments

@vanhaksreng
Copy link

A problem occurred configuring project ':pusher_channels_flutter'.

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.

gradle-8.3

@SaeedanTechnologies
Copy link

Same issue, I am facing from the past 2 days.

@sabbir420
Copy link

I am also facing the same issue when I upgraded the gradle and SDKs. Has anyone solved the issue yet?

@we-prajapati-c001
Copy link

try

pusher_channels_flutter:
    git:
      url: https://github.com/kishormainali/pusher-channels-flutter.git
      ref: master

@mss-swp
Copy link

mss-swp commented Oct 24, 2024

@we-prajapati-c001 where do I put that config?

@we-prajapati-c001
Copy link

instead of fetching the package from pub.dev, use below in you project pubspec.yaml

pusher_channels_flutter:
    git:
      url: https://github.com/kishormainali/pusher-channels-flutter.git
      ref: master

@mss-swp
Copy link

mss-swp commented Oct 25, 2024

Thank, I found out the problem that latest version of gradle don't support older version

@BunnyBuddy
Copy link

try

pusher_channels_flutter:
    git:
      url: https://github.com/kishormainali/pusher-channels-flutter.git
      ref: master

This works so far

@simonemarra
Copy link

simonemarra commented Nov 9, 2024

Hi, I found this stack overflow answer that helped me to solve the issue:

https://stackoverflow.com/a/77738936/2114245

I applied the mod on android root build.gradle file:

...

allprojects {
    repositories {
        google()
        mavenCentral()
    }
    // This code is where all the magic happens and fixes the error.
    subprojects {
        afterEvaluate { project ->
            if (project.hasProperty('android')) {
                project.android {
                    if (namespace == null) {
                        namespace project.group
                    }
                }
            }
        }
    }
    // This code is where all the magic happens and fixes the error.
}

...

then executed the following commands:

flutter clean

flutter pub get

flutter run

😄

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

7 participants