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

Need AGP 8+ support #215

Open
crobinsonpicdmo opened this issue Nov 13, 2023 · 1 comment
Open

Need AGP 8+ support #215

crobinsonpicdmo opened this issue Nov 13, 2023 · 1 comment

Comments

@crobinsonpicdmo
Copy link

I'm getting the error:

1: Task failed with an exception.
-----------
* What went wrong:
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.

As of AGP 8+ you must set the namespace in the android {} section of build.gradle. Is there an ETA for AGP 8+ support?

@alpesh031
Copy link

alpesh031 commented Sep 27, 2024

You can define common name space for all sub packages via adding few lines in project level build.gradle file. Consider adding below code inside subprojects block.

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

Example:-

subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    afterEvaluate { project ->
        if (project.hasProperty('android')) {
            project.android {
                if (namespace == null) {
                    namespace project.group
                }
            }
        }
    }
    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
        kotlinOptions {
            jvmTarget = "1.8"
        }
    }
}

I'm also facing many issues nowadays with many packages which are not updated with latest flutter, dart and kotlin versions.

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

2 participants