From c99e22e95874783d036ae00d1c0ea6ba289125ae Mon Sep 17 00:00:00 2001 From: Miguel Ruivo Date: Wed, 20 Nov 2019 00:48:53 +0000 Subject: [PATCH] Fix #171 Fixes an issue that could result in a crash when tapping multiple times in the same media file while picking, on some iOS devices. --- .gitignore | 1 + CHANGELOG.md | 9 +++++++++ README.md | 2 +- example/ios/Flutter/flutter_export_environment.sh | 10 ---------- example/ios/Podfile.lock | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 11 +++++++++-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ ios/Classes/FilePickerPlugin.m | 3 +++ pubspec.yaml | 2 +- 9 files changed, 33 insertions(+), 15 deletions(-) delete mode 100755 example/ios/Flutter/flutter_export_environment.sh create mode 100644 example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/.gitignore b/.gitignore index 73ee123..8678fba 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ GeneratedPluginRegistrant.m GeneratedPluginRegistrant.java build/ .flutter-plugins +example/ios/Flutter/flutter_export_environment.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index c0b0bfa..47a85d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 1.4.3+1 + +Removes checked flutter_export_environment.sh from example app. + +## 1.4.3 + +**Bug fix** + * Fixes an issue that could result in a crash when tapping multiple times in the same media file while picking, on some iOS devices (#171). + ## 1.4.2+1 Updates go-flutter dependencies. diff --git a/README.md b/README.md index 271db1d..19f4ec5 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Quick simple usage example: #### Single file ``` -List files = await FilePicker.getFile(); +File file = await FilePicker.getFile(); ``` #### Multiple files ``` diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh deleted file mode 100755 index ee9de00..0000000 --- a/example/ios/Flutter/flutter_export_environment.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/miguelruivo/devtools/flutter" -export "FLUTTER_APPLICATION_PATH=/Users/miguelruivo/Work/Personal/plugins/flutter_file_picker/example" -export "FLUTTER_TARGET=lib/main.dart" -export "FLUTTER_BUILD_DIR=build" -export "SYMROOT=${SOURCE_ROOT}/../build/ios" -export "FLUTTER_FRAMEWORK_DIR=/Users/miguelruivo/devtools/flutter/bin/cache/artifacts/engine/ios" -export "FLUTTER_BUILD_NAME=1.0.0" -export "FLUTTER_BUILD_NUMBER=1" diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 6fada42..6925d25 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -19,4 +19,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 1e5af4103afd21ca5ead147d7b81d06f494f51a2 -COCOAPODS: 1.7.5 +COCOAPODS: 1.8.4 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 8f59f17..bf9921f 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -182,6 +182,7 @@ 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = KJ6ARNKBG8; + ProvisioningStyle = Automatic; }; }; }; @@ -429,6 +430,8 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = KJ6ARNKBG8; ENABLE_BITCODE = NO; @@ -442,8 +445,9 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.mr.flutter.plugin.filepickerexample; + PRODUCT_BUNDLE_IDENTIFIER = com.mr.flutter.plugin.filepickerexampledemo; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -453,6 +457,8 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = KJ6ARNKBG8; ENABLE_BITCODE = NO; @@ -466,8 +472,9 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.mr.flutter.plugin.filepickerexample; + PRODUCT_BUNDLE_IDENTIFIER = com.mr.flutter.plugin.filepickerexampledemo; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Classes/FilePickerPlugin.m b/ios/Classes/FilePickerPlugin.m index f65666b..ed071ab 100644 --- a/ios/Classes/FilePickerPlugin.m +++ b/ios/Classes/FilePickerPlugin.m @@ -158,6 +158,9 @@ didPickDocumentsAtURLs:(NSArray *)urls{ // ImagePicker delegate - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { + if(_result == nil) { + return; + } NSURL *pickedVideoUrl = [info objectForKey:UIImagePickerControllerMediaURL]; NSURL *pickedImageUrl; diff --git a/pubspec.yaml b/pubspec.yaml index 588265f..ee3144f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: file_picker description: A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extension filtering support. author: Miguel Ruivo homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker -version: 1.4.2+1 +version: 1.4.3+1 dependencies: flutter: