Skip to content

fix(android): Drop legacy Flutter V1 embedding & add AGP 8 namespace#363

Open
jvallori wants to merge 2 commits intolukasgit:masterfrom
jvallori:fix/android-flutter3-agp8
Open

fix(android): Drop legacy Flutter V1 embedding & add AGP 8 namespace#363
jvallori wants to merge 2 commits intolukasgit:masterfrom
jvallori:fix/android-flutter3-agp8

Conversation

@jvallori
Copy link
Copy Markdown

Description

This PR resolves two fatal compilation errors that occur when attempting to build this plugin on modern Flutter implementations (Flutter 3.x) targeting Android SDK 34 / AGP 8.x.

1. Flutter Engine V2 Compatibility

The legacy fallback code for the Flutter V1 Engine (io.flutter.plugin.common.PluginRegistry.Registrar) was hard-deleted from the Android SDK by the core Flutter team in version 3.0. Since this plugin already natively implements the V2 Engine interfaces (FlutterPlugin and ActivityAware), the presence of the legacy V1 registerWith fallback methods was causing cannot find symbol compilation crashes. I have stripped the V1 legacy code entirely to restore compatibility with modern Flutter. Fixed a small variable scoping issue with a database cursor near onActivityResult as well.

2. AGP 8 Namespace Enforcement

Android Gradle Plugin 8.0+ strictly enforces the omission of the package attribute in the AndroidManifest.xml in favor of declarative namespace properties inside the module's build.gradle. Attempting to compile this package on a modern Android project resulted in a Namespace not specified error. I have explicitly declared the flutter.plugins.contactsservice.contactsservice namespace inside android/build.gradle to fix this.

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

Successfully merging this pull request may close these issues.

1 participant