flutter_mapbox_navigation icon indicating copy to clipboard operation
flutter_mapbox_navigation copied to clipboard

Add Namespace Support for Android Gradle Plugin (AGP) 8.x Compatibility

Open dschandrasekara opened this issue 1 year ago • 2 comments

The flutter_mapbox_navigation package is not compatible with Android Gradle Plugin (AGP) 8.x due to the absence of a namespace property in the android/build.gradle file. Starting with AGP 8.0.0, the namespace property is required for all Android modules to decouple the internal namespace from the AndroidManifest.xml file.

Steps to Reproduce:

  1. Add flutter_mapbox_navigation version 0.2.2 to a Flutter project.
  2. Update the project's Android Gradle Plugin to version 8.x (e.g., 8.1.1 or later).
  3. Attempt to sync or build the project.

Observed Behavior: The build fails with the following error:

A problem occurred configuring project ':flutter_mapbox_navigation'.
> 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: /Users/<username>/.pub-cache/hosted/pub.dev/flutter_mapbox_navigation-0.2.2/android/build.gradle. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

Expected Behavior: The project should build successfully with AGP 8.x when using the flutter_mapbox_navigation package.

dschandrasekara avatar Jan 22 '25 17:01 dschandrasekara

any workarounds or fixes ?

bamlakamare avatar Feb 11 '25 20:02 bamlakamare

@bamlakamare please, checkout the project an link the local code to flutter project. Then apply these two PRs https://github.com/eopeter/flutter_mapbox_navigation/pull/386 https://github.com/eopeter/flutter_mapbox_navigation/pull/370 Then application will be run without issue.

dschandrasekara avatar Feb 12 '25 11:02 dschandrasekara