flutter-form-builder-ecosystem / phone_number

Flutter plugin for parsing, formatting and validating international phone numbers.
https://pub.dev/packages/phone_number
BSD 3-Clause "New" or "Revised" License
81 stars 63 forks source link

Add Namespace to Support Gradle 8.0 #116

Closed friebetill closed 10 months ago

friebetill commented 11 months ago

Context: Recent updates in Gradle 8.0 have introduced a requirement for specifying a namespace in the build.gradle file of Android projects. This change impacts the build process of the phone_number Flutter package, leading to build failures with the following error message:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':phone_number'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Please specify a namespace in the module's build.gradle file like so:

     android {
         namespace 'com.example.namespace'
     }

     If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
...

Changes: This pull request addresses the build failure by adding a namespace to the build.gradle file of the phone_number package. The namespace is aligned with the existing package structure to ensure consistency and avoid any potential conflicts.

Implementation:

Impact:

I look forward to your review and suggestions. This update aims to maintain the compatibility and functionality of the phone_number package with the latest Gradle version.