Narada Vikum
Narada Vikum

Reputation: 31

A problem occurred configuring project ':gallery_saver'

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.

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.[enter image description here] Get more help at https://help.gradle.org.[enter image description here]

BUILD FAILED in 5m 44s Error: Gradle task assembleDebug failed with exit code 1 enter image description here

how to fix this error

Upvotes: 3

Views: 619

Answers (1)

ali s.
ali s.

Reputation: 11

image_gallery_saver module or dependency is missing a namespace property in its build.gradle file You can add it manually.

In Windows, go to:

C:\Users<YourUsername>\AppData\Local\Pub\Cache\hosted\pub.dev\image_gallery_saver-2.0.3\android

or

C:\Users<YourUsername>\AppData\Roaming\Pub\Cache

This is the path where flutter normally download the dependencies

Add your package name i.e namespace = "com.example.myapp" into android block.

And run your project. If you get another error of jvm related, add this in android block:

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = JavaVersion.VERSION_1_8
}

Upvotes: 0

Related Questions