pusher-channels-flutter icon indicating copy to clipboard operation
pusher-channels-flutter copied to clipboard

Namespace not specified

Open vanhaksreng opened this issue 1 year ago • 7 comments

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

vanhaksreng avatar Oct 07 '24 11:10 vanhaksreng

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

SaeedanTechnologies avatar Oct 09 '24 05:10 SaeedanTechnologies

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

sabbir420 avatar Oct 18 '24 09:10 sabbir420

try

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

we-chintan-p001 avatar Oct 22 '24 07:10 we-chintan-p001

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

mss-swp avatar Oct 24 '24 09:10 mss-swp

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

we-chintan-p001 avatar Oct 24 '24 09:10 we-chintan-p001

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

mss-swp avatar Oct 25 '24 09:10 mss-swp

try

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

This works so far

BunnyBuddy avatar Oct 31 '24 06:10 BunnyBuddy

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

😄

simonemarra avatar Nov 09 '24 17:11 simonemarra