miguelpruivo / flutter_file_picker

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
MIT License
1.32k stars 653 forks source link

The path returned by FilePicker.platform.saveFile does not exist on ios #1504

Closed kjxbyz closed 3 months ago

kjxbyz commented 4 months ago

Before creating an issue, make sure that you are on the latest file_picker version and that there aren't already any similar opened inssues. Also, check if it isn't described on the Wiki, specially on Troubleshooting page.

Also, sometimes a simple flutter clean and flutter build again with latest file_picker version, may end up by fixing cached issues, so I encourage you to first do so.

Describe the bug The path returned by FilePicker.platform.saveFile does not exist on ios

Platform

Platform OS version What version did it happen?

How are you picking?

final savedPath = await FilePicker.platform.saveFile(
                          fileName: '${DateFormat("yyyy-MM-dd'T'HH:mm:ss").format(DateTime.now())}.png',
                          type: FileType.image,
                          bytes: bytes,
                        );

Details to reproduce the issue The path returned by FilePicker.platform.saveFile does not exist on ios

Error Log

flutter: β”‚ πŸ› savedPath: /private/var/mobile/Containers/Shared/AppGroup/B14C6240-7E8C-49CE-99BB-8F7AF53EA84A/File Provider Storage/ep-signature-2024-05-07T14:08:14.png
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: \^[[38;5;196mβ”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€<…>
flutter: \^[[38;5;196mβ”‚ 'package:image_cropper_platform_interface/src/method_channel/method_channel_image_cropper.dart': Failed assertion: line 72 pos 12: 'await File(sourcePath).exists()': is not true.<…>
flutter: \^[[38;5;196mβ”œβ”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„<…>
flutter: \^[[38;5;196mβ”‚ #0   _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)<…>
flutter: \^[[38;5;196mβ”‚ #1   _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)<…>
flutter: \^[[38;5;196mβ”‚ #2   MethodChannelImageCropper.cropImage (package:image_cropper_platform_interface/src/method_channel/method_channel_image_cropper.dart:72:12)<…>
flutter: \^[[38;5;196mβ”‚ #3   <asynchronous suspension><…>
flutter: \^[[38;5;196mβ”‚ #4   SignatureUtil.cropImage (package:expert_planet/modules/mine/utils/signature_util.dart:117:25)<…>
flutter: \^[[38;5;196mβ”‚ #5   <asynchronous suspension><…>
flutter: \^[[38;5;196mβ”‚ #6   MineDialogs.showUploadBottomSheet.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:expert_planet/modules/mine/utils/mine_dialogs.dart:1512:48)<…>
flutter: \^[[38;5;196mβ”‚ #7   <asynchronous suspension><…>
flutter: \^[[38;5;196mβ”œβ”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„β”„<…>
flutter: \^[[38;5;196mβ”‚ β›” null<…>

Screenshots and/or video If applicable, add screenshots or video to help explain your problem.

Flutter Version details

[βœ“] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-x64, locale zh-Hans-CN)
    β€’ Flutter version 3.19.6 on channel stable at /Users/ying/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 54e66469a9 (3 周前), 2024-04-17 13:08:03 -0700
    β€’ Engine revision c4cd48e186
    β€’ Dart version 3.3.4
    β€’ DevTools version 2.31.1

[βœ“] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    β€’ Android SDK at /Users/ying/Android/sdk
    β€’ Platform android-34, build-tools 34.0.0
    β€’ ANDROID_HOME = /Users/ying/Android/sdk
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 15.3)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Build 15E204a
    β€’ CocoaPods version 1.15.2

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 2023.3)
    β€’ 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.10+0-17.0.10b1087.21-11572160)

[βœ“] IntelliJ IDEA Ultimate Edition (version 2024.1.1)
    β€’ IntelliJ at /Applications/IntelliJ IDEA.app
    β€’ Flutter plugin version 79.0.3
    β€’ Dart plugin version 241.15989.9

[βœ“] Connected device (5 available)
    β€’ sdk gphone64 x86 64 (mobile) β€’ emulator-5554                        β€’ android-x64    β€’ Android 13 (API 33)
      (emulator)
    β€’ Kimmy's iPhone (mobile)      β€’ 00008020-000A1D110A32002E            β€’ ios            β€’ iOS 17.4.1 21E236
    β€’ iPhone 15 Pro Max (mobile)   β€’ 24AF00F3-A044-453B-A4EF-01834A59AA46 β€’ ios            β€’
      com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
    β€’ macOS (desktop)              β€’ macos                                β€’ darwin-x64     β€’ macOS 14.4.1 23E224
      darwin-x64
    β€’ Chrome (web)                 β€’ chrome                               β€’ web-javascript β€’ Google Chrome
      124.0.6367.119
    ! Error: Browsing on the local area network for Kimmy's AppleΒ Watch. Ensure the device is unlocked and discoverable
      via Bluetooth. (code -27)

Additional context Add any other context about the problem here.

kjxbyz commented 4 months ago

Sorry, I seem to have missed this configuration.

<key>UISupportsDocumentBrowser</key>
<true/>
github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] commented 3 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.