Fix Android Flutter embedding resolution on newer SDKs#456
Fix Android Flutter embedding resolution on newer SDKs#456cdeil wants to merge 1 commit intoultralytics:mainfrom
Conversation
|
👋 Hello @cdeil, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
The change looks clean based on the diff provided. Removing the legacy Flutter SDK path discovery and manual flutter.jar/embedding fallback logic is consistent with relying on modern Flutter Gradle integration, and I do not see a clear bug or regression in the changed lines alone.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@pderrenger any chance to find a reviewer here and get this fixed? |
|
Thanks for the ping — I can’t promise review timing, but keeping this PR narrowly scoped with passing CI will help it move faster; see the contributing guide and CI docs for the current merge requirements. |
I ran into two Android build issues ( #455 and this one) today and the coding agent suggested that both are things that should be resolved in the
ultralytics_yolopackage itself.cc @john-rocky since you added this
build.gradleconfig ca a year ago.Coding agent:
Summary
This removes the plugin's hard-coded Android flutter.jar lookup from android/build.gradle.
The current build script prefers legacy local SDK paths like bin/cache/artifacts/engine/android-arm/flutter.jar whenever flutter.sdk or FLUTTER_ROOT is set. Those paths are no longer present in newer Flutter SDKs such as Flutter 3.41.x, which causes Android builds to fail before the plugin can compile.
Modern Flutter plugin templates no longer declare these manual embedding dependencies. Letting Flutter and Gradle provide the embedding is the compatible path for current SDKs and avoids coupling the plugin to obsolete engine cache layouts.
Changes
Note: example/android/ultralytics_yolo_plugin is a symlink to android, so the single tracked Gradle change covers both locations.
Validation
Context
This addresses the second Android compatibility problem discussed alongside issue #455. The Java 17 toolchain requirement remains a separate issue.
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
🔧 Simplifies Android Gradle configuration to fix Flutter embedding resolution issues on newer SDK setups.
📊 Key Changes
android/build.gradleusinglocal.propertiesandFLUTTER_ROOT.compileOnlyreferences to architecture-specificflutter.jarfiles.io.flutter:flutter_embedding_release.🎯 Purpose & Impact