Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Add Namespace to Support Gradle 8.0 #116

Merged
merged 2 commits into from
Jan 6, 2024

Conversation

friebetill
Copy link

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:

  • Added the namespace declaration in the android block of the build.gradle file.
  • Ensured the namespace is reflective of the package's existing structure by mirroring the package name used in the AndroidManifest.xml.

Impact:

  • This change is necessary for compatibility with Gradle 8.0 and newer versions.
  • It ensures that developers using the phone_number package can build their Flutter applications without encountering the specified build error.

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.

@deandreamatias deandreamatias merged commit 14a6f8b into flutter-form-builder-ecosystem:main Jan 6, 2024
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants