Skip to content

Flutter ImagePicker Plugin (Unhandled Exception: UnimplementedError: getMedia() has not been implemented.) #130250

@JaimisTechno

Description

@JaimisTechno

Is there an existing issue for this?

Steps to reproduce

I am using image picker latest version

Expected results

It should open Gallery

Actual results

Unhandled Exception: UnimplementedError: getMedia() has not been implemented.

Code sample

Code sample
class FileUtils {
  FileUtils._();
  static final ImagePicker _picker = ImagePicker();

  static Future<List<File>> pickMultiImageAndVideo() async {
    List<XFile> xFiles = await _picker.pickMultipleMedia();
    return xFiles.map((e) => File(e.path)).toList();
  }
  }

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
E/flutter (30665): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: UnimplementedError: getMedia() has not been implemented.
E/flutter (30665): #0      ImagePickerPlatform.getMedia (package:image_picker_platform_interface/src/platform_interface/image_picker_platform.dart:231:5)
E/flutter (30665): #1      ImagePicker.pickMultipleMedia (package:image_picker/image_picker.dart:244:21)
E/flutter (30665): #2      FileUtils.pickMultiImageAndVideo (package:gusi_student/core/utils/utils/file_utils.dart:33:40)
E/flutter (30665): #3      _ExamStepFirstState._galleryPermission.<anonymous closure> (package:gusi_student/views/screens/create_new_exam/views/exam_step_first.dart:223:45)
E/flutter (30665): #4      PermissionUtils.checkPermission (package:gusi_student/core/utils/permission_utils.dart:18:16)
E/flutter (30665): <asynchronous suspension>

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.3.1 22E772610a darwin-arm64, locale en-IN)
    • Flutter version 3.10.5 on channel stable at /Users/jaimis/Developer/flutter-sdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (4 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/jaimis/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/jaimis/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] Connected device (4 available)
    • ONEPLUS A3003 (mobile) • 192.168.29.131:5555 • android-arm64  • Android 9 (API 28)
    • Pixel 4a (mobile)      • 192.168.29.198:5555 • android-arm64  • Android 13 (API 33)
    • macOS (desktop)        • macos               • darwin-arm64   • macOS 13.3.1 22E772610a darwin-arm64
    • Chrome (web)           • chrome              • web-javascript • Google Chrome 114.0.5735.198

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listp: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions