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

Add namespace Property to flutter_tpay for Compatibility with AGP 8.0+ #11

Open
jslowinski opened this issue Nov 22, 2024 · 0 comments
Open

Comments

@jslowinski
Copy link

Hi,

I've encountered an issue when using the flutter_tpay library in a Flutter project with Android Gradle Plugin (AGP) version 8.0 and above. The build process fails with the following error message:

A problem occurred configuring project ':flutter_tpay'.
> 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 error occurs because AGP 8.0 and above require the namespace property to be specified in the build.gradle file of each module. The flutter_tpay library's build.gradle file currently doesn't include this property.
Solution:

Adding the following line to the android block in flutter_tpay/android/build.gradle resolves the issue:

android {
    namespace 'com.tpay.tpay'
    // ... existing configurations
}

By specifying the namespace, the library becomes compatible with AGP 8.0 and above, and the build process completes successfully.

Suggestion:

Please consider updating the build.gradle file in the flutter_tpay library to include the namespace property, which will enhance compatibility with newer versions of AGP and prevent build errors for users.

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

1 participant