Skip to content

Conversation

@ssoad
Copy link

@ssoad ssoad commented Dec 26, 2025

fix: AGP 8+ namespace compatibility and dependency updates

Summary

This PR fixes build failures when using ar_flutter_plugin with Android Gradle Plugin 8.0+ and newer Flutter/Dart versions.

Problem

Starting with AGP 8.0, the namespace property is required in build.gradle. The plugin was failing to build with: Namespace not specified. Specify a namespace in the module's build file.

Additionally, there were compatibility issues with:

  • Kotlin version too old for newer AGP
  • JVM target mismatch between Java and Kotlin compilation
  • permission_handler using deprecated v1 Flutter embedding
  • Gradle wrapper in example app incompatible with Java 21

Changes

android/build.gradle

  • Added namespace 'io.carius.lars.ar_flutter_plugin'
  • Updated Kotlin version: 1.3.501.8.0
  • Updated Android Gradle Plugin: 4.1.07.3.0
  • Added kotlinOptions { jvmTarget = '1.8' }

android/src/main/AndroidManifest.xml

  • Removed redundant package attribute (now defined via namespace)

pubspec.yaml

  • Updated permission_handler: ^10.4.5^12.0.0

example/android/gradle/wrapper/gradle-wrapper.properties

  • Updated Gradle: 7.58.5

Testing

  • Tested with Flutter 3.x stable
  • Tested with AGP 8.1.0
  • Verified AR functionality on Android device

Checklist

  • No breaking changes
  • Tested on Android
  • [x ] Tested on iOS (N/A for these changes)

for AGP 8.0 compatibility
for AGP 8.0 compatibility
…update Android build configurations including Gradle wrapper.
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