Skip to content

ImagePicker should avoid making I/O operations on the platform thread #91393

@xster

Description

@xster
        at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:281)
        at java.io.File.exists(File.java:815)
        at android.app.ContextImpl.getDataDir(ContextImpl.java:2539)
        at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:626)
        at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:853)
        at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:475)
        at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:188)
        at io.flutter.plugins.imagepicker.ImagePickerCache.<init>(ImagePickerCache.java:49)
        at io.flutter.plugins.imagepicker.ImagePickerPlugin.constructDelegate(ImagePickerPlugin.java:220)
        at io.flutter.plugins.imagepicker.ImagePickerPlugin.setup(ImagePickerPlugin.java:188)
        at io.flutter.plugins.imagepicker.ImagePickerPlugin.onAttachedToActivity(ImagePickerPlugin.java:157)
        at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.add(FlutterEngineConnectionRegistry.java:153)
        at third_party.flutter_plugins.image_picker.android.ImagePickerPluginRegistrant.registerWith(ImagePickerPluginRegistrant.java:20)
        at redacted
        at redacted
        at redacted
        at io.flutter.embedding.android.FlutterFragment.configureFlutterEngine(FlutterFragment.java:1181)
        at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:187)
        at io.flutter.embedding.android.FlutterFragment.onAttach(FlutterFragment.java:743)

See compliance in https://developer.android.com/reference/android/os/StrictMode. Accessing I/O APIs is an anti-pattern on the main/platform thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listcustomer: googleVarious Google teamsp: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.platform-androidAndroid applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions