From 079dc5f6b2fc78659d4745aaa5f2f30aa2762c0b Mon Sep 17 00:00:00 2001 From: panmari Date: Wed, 8 Jan 2025 21:39:28 +0100 Subject: [PATCH] Adds instructions for image streams on Android. There's currently several open issues of folks running into this issue. Worth documenting. Jointly updating example app with the fix, and a random kotlin update that was required for starting the example app. --- README.md | 4 ++ packages/example/android/settings.gradle | 2 +- packages/example/pubspec.lock | 52 ++++++++++++++---------- packages/example/pubspec.yaml | 4 +- 4 files changed, 38 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 1e2ff21b..8e097a7f 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,10 @@ For iOS details read [this](https://developers.google.com/ml-kit/migration/ios). Find the example app [here](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master/packages/example). +### Consuming image streams on Android + +Until https://github.com/flutter/flutter/issues/145961 is resolved, the most recent version of the camera package doesn't support the required image formats. To make things work, manually add the legacy plugin via the instructions from https://pub.dev/packages/camera_android. + ## Contributing Contributions are welcome. diff --git a/packages/example/android/settings.gradle b/packages/example/android/settings.gradle index 27e07281..307aa0dd 100644 --- a/packages/example/android/settings.gradle +++ b/packages/example/android/settings.gradle @@ -19,7 +19,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "org.jetbrains.kotlin.android" version "1.7.10" apply false + id "org.jetbrains.kotlin.android" version "2.1.0" apply false id "com.android.application" version "8.3.2" apply false } diff --git a/packages/example/pubspec.lock b/packages/example/pubspec.lock index d9d49abb..606bc631 100644 --- a/packages/example/pubspec.lock +++ b/packages/example/pubspec.lock @@ -21,18 +21,26 @@ packages: dependency: "direct main" description: name: camera - sha256: dfa8fc5a1adaeb95e7a54d86a5bd56f4bb0e035515354c8ac6d262e35cec2ec8 + sha256: "26ff41045772153f222ffffecba711a206f670f5834d40ebf5eed3811692f167" url: "https://pub.dev" source: hosted - version: "0.10.6" + version: "0.11.0+2" camera_android: - dependency: transitive + dependency: "direct main" description: name: camera_android - sha256: "65d90101b20249dbe9df77ef6095c120b6c4eef2234e73ff9bdcdd8d91866410" + sha256: "19b7226387218864cb2388e1ad5db7db50d065222f5511254b03fc397dd21a5e" url: "https://pub.dev" source: hosted - version: "0.10.9+12" + version: "0.10.9+17" + camera_android_camerax: + dependency: transitive + description: + name: camera_android_camerax + sha256: "2bb0724371bae3c0889d7e0b1665357e4aa6ba6c8d32ffa3e178098ba81ed3df" + url: "https://pub.dev" + source: hosted + version: "0.6.11" camera_avfoundation: dependency: transitive description: @@ -77,10 +85,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" cross_file: dependency: transitive description: @@ -372,18 +380,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -508,7 +516,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: @@ -521,10 +529,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -545,10 +553,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -561,10 +569,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" typed_data: dependency: transitive description: @@ -585,10 +593,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" web: dependency: transitive description: @@ -606,5 +614,5 @@ packages: source: hosted version: "1.1.0" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/packages/example/pubspec.yaml b/packages/example/pubspec.yaml index b51671c6..2e39599a 100644 --- a/packages/example/pubspec.yaml +++ b/packages/example/pubspec.yaml @@ -15,7 +15,9 @@ dependencies: sdk: flutter flutter_pdfview: ^1.3.3 image_picker: ^1.1.2 - camera: ^0.10.6 + camera: ^0.11.0+2 + # The default Android implementation from camera_android_camerax doesn't support the required image format. + camera_android: ^0.10.9+17 path: ^1.9.0 path_provider: ^2.1.4