Coder Social home page Coder Social logo

sidlatau / flutter_document_picker Goto Github PK

View Code? Open in Web Editor NEW
39.0 39.0 23.0 132 KB

Allows user pick a document. Picked document is copied to app temporary directory. Optionally allows pick document with specific extension only.

License: Apache License 2.0

Kotlin 39.80% Swift 19.58% Objective-C 1.40% Dart 32.75% Ruby 6.46%
dart flutter plugin

flutter_document_picker's People

Contributors

alexei-kruk-idf avatar eneskaraosman avatar linusu avatar morrica avatar robertodrowaz avatar sidlatau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

flutter_document_picker's Issues

Unable to resolve dependency

Error

Unable to resolve dependency for ':app@dynamicProfile/compileClasspath': Could not resolve project :flutter_document_picker.
Open File
Show Details


Unable to resolve dependency for ':app@dynamicProfileUnitTest/compileClasspath': Could not resolve project :flutter_document_picker.
Open File
Show Details


Unable to resolve dependency for ':app@profile/compileClasspath': Could not resolve project :flutter_document_picker.
Open File
Show Details


Unable to resolve dependency for ':app@profileUnitTest/compileClasspath': Could not resolve project :flutter_document_picker.
Open File
Show Details


Unable to resolve dependency for ':app@dynamicRelease/compileClasspath': Could not resolve project :flutter_document_picker.
Open File
Show Details


Unable to resolve dependency for ':app@dynamicReleaseUnitTest/compileClasspath': Could not resolve project :flutter_document_picker.
Open File
Show Details

Flutter Doctor

[✓] Flutter (Channel master, v0.9.7-pre.60, on Mac OS X 10.14 18A391, locale en-ID)
    • Flutter version 0.9.7-pre.60 at /Users/Maulana/Development/flutter
    • Framework revision e438632165 (2 hours ago), 2018-10-05 20:00:11 -0700
    • Engine revision 572fa5646a
    • Dart version 2.1.0-dev.6.0.flutter-c6254163dc

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/Maulana/Development/AndroidSDK
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 2.0.0
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 29.0.2
    • Dart plugin version 181.5616
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.27.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.18.0

[✓] Connected device (2 available)
    • Android SDK built for x86 • emulator-5554                            • android-x86 • Android 8.1.0 (API 27) (emulator)
    • Eyro Labs iPhone 6        • 20747ee7b210a90b2bf3e80624feb7c635fd59ff • ios         • iOS 12.0

• No issues found!

BREAKING ISSUE! Cannot resolve dependencies. Causes builds to fail

Hi, yesterday, my project stopped building and it threw an error, which i tracked down to be caused by 2 packages. flutter_email_sender, and flutter_document_sender.
carbon 2
carbon 3
The first one was resolved after switching the target sdk version to 28, although i doubt that's a real fix. I however don't know if this is related to your project or not. Once the first one was resolved, I received the second one. Which I tracked down to these 2 packages. I'm not sure why it's causing it, but after removing the 2 packages from my dependencies, the project builds. I tested this in a completely separate simple project with only 3 widgets and no external dependencies and simply added flutter_document_picker to the pubspec.yaml and the project would no longer build with the error below.

Unable to resolve dependency for ':app@dynamicProfile/compileClasspath': Could not resolve project :flutter_document_picker.

Unable to resolve dependency for ':app@dynamicProfileUnitTest/compileClasspath': Could not resolve project :flutter_document_picker.

Unable to resolve dependency for ':app@profile/compileClasspath': Could not resolve project :flutter_document_picker.

Unable to resolve dependency for ':app@profileUnitTest/compileClasspath': Could not resolve project :flutter_document_picker.

Unable to resolve dependency for ':app@dynamicRelease/compileClasspath': Could not resolve project :flutter_document_picker.

Unable to resolve dependency for ':app@dynamicReleaseUnitTest/compileClasspath': Could not resolve project :flutter_document_picker.

I'm currently using flutter_document_picker: ^1.0.1

FileNotFoundException causes app crash under unknown circumstances

Similar to issue #17, but occurs using version 4.0.0 and play store crash details do not show actual URI that caused FileNotFoundException.

I would recommend that a broad try/catch be inserted as far up the call stack as possible and a error Result be returned if any Exception is propagated up to that point. Otherwise an unknown Exception occurring in the plugin code can result in an app crash that won't be caught by the plugin caller from the Dart side of the channel.

Below is the full stacktrace provided by the play store crash reports for this issue.

java.lang.RuntimeException: 
  at android.os.AsyncTask$3.done (AsyncTask.java:300)
  at java.util.concurrent.FutureTask.finishCompletion (FutureTask.java:355)
  at java.util.concurrent.FutureTask.setException (FutureTask.java:222)
  at java.util.concurrent.FutureTask.run (FutureTask.java:242)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:587)
  at java.lang.Thread.run (Thread.java:841)
Caused by: java.io.FileNotFoundException: 
  at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel (DatabaseUtils.java:146)
  at android.content.ContentProviderProxy.openTypedAssetFile (ContentProviderProxy.java:682)
  at android.content.ContentResolver.openTypedAssetFileDescriptor (ContentResolver.java:1067)
  at android.content.ContentResolver.openAssetFileDescriptor (ContentResolver.java:907)
  at android.content.ContentResolver.openInputStream (ContentResolver.java:632)
  at com.sidlatau.flutterdocumentpicker.FileCopyTaskLoader.copyToTemp (FileCopyTaskLoader.java:184)
  at com.sidlatau.flutterdocumentpicker.FileCopyTaskLoader.loadInBackground (FileCopyTaskLoader.java:167)
  at com.sidlatau.flutterdocumentpicker.FileCopyTaskLoader.loadInBackground (FileCopyTaskLoader.java:165)
  at android.content.AsyncTaskLoader.onLoadInBackground (AsyncTaskLoader.java:312)
  at android.content.AsyncTaskLoader$LoadTask.doInBackground (AsyncTaskLoader.java:69)
  at android.content.AsyncTaskLoader$LoadTask.doInBackground (AsyncTaskLoader.java:57)
  at android.os.AsyncTask$2.call (AsyncTask.java:288)
  at java.util.concurrent.FutureTask.run (FutureTask.java:237)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:587)
  at java.lang.Thread.run (Thread.java:841)

[Enhancement] Close option

Is there a way to be able to close the picker instead of having to back out of the folders to the root of the drive first?

After copying file to the cache directory, the file is corrupted

The issue is related to the invalid file copying process, where the target file has wrong size (always x*1024 bytes, x=1,2,3...)

To fix this:
File android/src/main/kotlin/com/sidlatau/flutterdocumentpicker/FlutterDocumentPickerDelegate.kt
Line 160
Replace with this:

BufferedInputStream(context.contentResolver.openInputStream(uri)).use { inputStream ->
	BufferedOutputStream(FileOutputStream(file)).use { outputStream ->
		val buf = ByteArray(1024)
		var len = inputStream.read(buf)
		while (len != -1) {
			outputStream.write(buf, 0, len)
			len = inputStream.read(buf)
		}
	}
}

iOS build failed

Hello
after adding flutter_document_picker to my clean project have problem:
Error output from Xcode build:

** BUILD FAILED **

Xcode's output:

=== BUILD TARGET flutter_document_picker OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/denis/Documents/work/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_document_picker-3.0.0/ios/Classes/FlutterDocumentPickerPlugin.m:2:9: fatal error: 'flutter_document_picker/flutter_document_picker-Swift.h' file not found
#import <flutter_document_picker/flutter_document_picker-Swift.h>

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Could not build the application for the simulator.

My pubspec.yaml :
dependencies:
flutter:
sdk: flutter
flutter_document_picker: ^3.0.0

cupertino_icons: ^0.1.2

dev_dependencies:
flutter_test:
sdk: flutter

Thank you.

Execution failed for task ':flutter_document_picker:compileReleaseKotlin'. Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (1.8) and 'compileReleaseKotlin' (17).

Build fails in Flutter sdk 3.19.5.
This can be avoided by writing the following to build.gradle, but since it requires downloading the package source and including it in the project, I would like to request official support for the package.

android {

compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
}

kotlin {
    jvmToolchain(17)
}

}

Status bar is not shown

When dialog is open statusBarBrightness should be dark because status bar color is always black.

Support for Web

Hi, I'm using flutter_document_picker: ^3.0.1 on flutter web. Its not opening any document picker with the following code:

FlutterDocumentPicker.openDocument().then((path) {
      setState(() {
        voucherFilePath = path;
      });
    }).catchError((error){
      print(error);
    });

No error is catched.

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.15.2-pre.9, on Mac OS X 10.14.6 18G95, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.40.2)
[✓] Connected device (3 available)

• No issues found!

Process finished with exit code 0.

Not sure whether the plugin has support for web. But I can see the web caption ob pub.dev:

Screenshot 2020-02-07 at 5 00 44 PM

No named parameter with the name 'allowedMimeType'

Hi,
Here in the following snippet, it shows me that allowedMimeType is not a parameter, can you please let me know how we can resolve it?

FlutterDocumentPickerParams params = FlutterDocumentPickerParams(
allowedMimeType: _checkByMimeType ? _mimeTypeController.text : null,
allowedFileExtensions: _checkByCustomExtension
? _extensionController.text
.split(' ')
.where((x) => x.isNotEmpty)
.toList()
: null,
allowedUtiTypes: _iosPublicDataUTI
? null
: _utiController.text
.split(' ')
.where((x) => x.isNotEmpty)
.toList(),

  );

allowedMimeTypes supress selecting the mime type

According to docs, Flutter Document Picker parameter allowedMimeTypes allows to list mime types which will be shown in select dialog.

/// Android only. Allowed MIME types. /// Only files with provided
MIME types will be shown in document picker. /// If list is null or
empty - */* MIME type will be used.

Instead, when I use allowedMimeTypes: ['text/csv'] then csv file is not allowed to select in picker. The file is in grey color i.e. it innactive in select screen.

  final FlutterDocumentPickerParams params = FlutterDocumentPickerParams(
    allowedMimeTypes: ['text/csv'],
  );

So what's the purpose of this parameter then?

Unsupported Swift Version

Problem:
The target "flutter_document_picker" contains source code developed with Swift 2.x. Xcode 9 does not support building or migrating to Swift 2.x targets.

Additional Information:
** BUILD FAILED **
Xcode's output:

The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.
Could not build the precompiled application for the device.

Details ( where the problem exist):

  • Xcode version 10.0 with Swift 4.2 pre-installed.
  • Flutter 0.9.2 • channel dev • https://github.com/flutter/flutter.git
    Framework • revision 85b4670b2a (11 days ago) • 2018-09-19 14:59:23 -0700
    Engine • revision 2e8e96fad1
    Tools • Dart 2.1.0-dev.4.0.flutter-4eb879133a
  • flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel dev, v0.9.2, on Mac OS X 10.13.6 17G65, locale en-SG)
    [✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
    [✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    [✓] Android Studio (version 3.1)
    [✓] IntelliJ IDEA Community Edition (version 2018.1.5)
    [!] Connected devices
    ! No devices available

Unable to run on ios

I was unable to compile the plugin on iOS.
Error: The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.

Error on iOS

Hi,

I get this error:

Launching lib/main.dart on iPhone Xs in debug mode...
Running Xcode build...
Xcode build done. 3.4s
Failed to build iOS app
Error output from Xcode build:

** BUILD FAILED **

Xcode's output:

The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 4.0, 4.2, 5.0. This setting can be set in the build settings editor.

image

Apparently a setting is missing from the picker?

Thanks!

Arno

Android build fails

Android Gradle build fails. I have done all the digging Gradle allows to and this is the most useful information I could get out of it:

Using incremental javac compilation for :flutter_document_picker debug.
Using incremental javac compilation for :flutter_document_picker debugUnitTest.
Using incremental javac compilation for :flutter_document_picker release.
Using incremental javac compilation for :flutter_document_picker releaseUnitTest.
Using incremental javac compilation for :flutter_document_picker debugAndroidTest.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':flutter_document_picker'.
> Failed to notify project evaluation listener.
   > java.lang.AbstractMethodError (no error message)

The Gradle --scan also shows this:

Failed to notify project evaluation listener.
> (No message provided)

org.gradle.api.ProjectConfigurationException:  A problem occurred configuring project ':flutter_document_picker'.

Caused by:  org.gradle.internal.event.ListenerNotificationException: 
Failed to notify project evaluation listener.

Caused by: java.lang.AbstractMethodError: 
(No message provided)
at org.jetbrains.kotlin.gradle.plugin.KotlinPluginKt.resolveSubpluginArtifacts(KotlinPlugin.kt:780)
at org.jetbrains.kotlin.gradle.plugin.KotlinPluginKt.loadSubplugins(KotlinPlugin.kt:754)
at org.jetbrains.kotlin.gradle.plugin.KotlinPluginKt.access$loadSubplugins(KotlinPlugin.kt:1)
at org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler$handleProject$2.execute(KotlinPlugin.kt:551)
at org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler$handleProject$2.execute(KotlinPlugin.kt:496)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)

Crash when using in combination with firebase_messaging

Getting the following error when trying to use background messaging with firebase_messaging

E/MethodChannel#plugins.flutter.io/firebase_messaging(16003): Failed to handle method call
E/MethodChannel#plugins.flutter.io/firebase_messaging(16003): java.lang.IllegalStateException: registrar.activity() must not be null
E/MethodChannel#plugins.flutter.io/firebase_messaging(16003): 	at com.sidlatau.flutterdocumentpicker.FlutterDocumentPickerPlugin$Companion.registerWith(FlutterDocumentPickerPlugin.kt:23)
E/MethodChannel#plugins.flutter.io/firebase_messaging(16003): 	at com.sidlatau.flutterdocumentpicker.FlutterDocumentPickerPlugin.registerWith(Unknown Source:2)
E/MethodChannel#plugins.flutter.io/firebase_messaging(16003): 	at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:51)

The problem is that there is no Activity when running in the background.

similar issue that was solved in another lib: flutternetwork/WiFiFlutter#45

Unable to determine Swift version

When I try to execute 'flutter run' command, there is an error which says

[!] Unable to determine Swift version for the following pods:
- `flutter_document_picker` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the
`SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.

Flutter doctor doesn't quote any errors. Please look into the error and help me in resolving the error.

flutter run output

Launching lib/main.dart on iPhone Xʀ in debug mode...
Running pod install...                                              1.0s

CocoaPods' output:

↳

      Preparing



    Analyzing dependencies



    Inspecting targets to integrate

      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)



    Fetching external sources

    -> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`

    -> Fetching podspec for `flutter_document_picker` from `.symlinks/plugins/flutter_document_picker/ios`

    -> Fetching podspec for `flutter_full_pdf_viewer` from `.symlinks/plugins/flutter_full_pdf_viewer/ios`

    -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`

    -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`

    -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`

    -> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`



    Resolving dependencies of `Podfile`



    Comparing resolved specification to the sandbox manifest

      A FMDB

      A Flutter

      A flutter_document_picker

      A flutter_full_pdf_viewer

      A path_provider

      A shared_preferences

      A sqflite

      A url_launcher



    Downloading dependencies



    -> Installing FMDB (2.7.5)

      > Copying FMDB from `/Users/akki/Library/Caches/CocoaPods/Pods/Release/FMDB/2.7.5-2ce00` to `Pods/FMDB`



    -> Installing Flutter (1.0.0)



    -> Installing flutter_document_picker (0.0.1)



    -> Installing flutter_full_pdf_viewer (1.0.1)



    -> Installing path_provider (0.0.1)



    -> Installing shared_preferences (0.0.1)



    -> Installing sqflite (0.0.1)



    -> Installing url_launcher (0.0.1)

      - Running pre install hooks

    [!] Unable to determine Swift version for the following pods:



    - `flutter_document_picker` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the

    `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.



    /usr/local/Cellar/cocoapods/1.7.4/libexec/gems/cocoapods-1.7.4/lib/cocoapods/installer/xcode/target_validator.rb:122:in `verify_swift_pods_swift_version'

    /usr/local/Cellar/cocoapods/1.7.4/libexec/gems/cocoapods-1.7.4/lib/cocoapods/installer/xcode/target_validator.rb:37:in `validate!'

    /usr/local/Cellar/cocoapods/1.7.4/libexec/gems/cocoapods-1.7.4/lib/cocoapods/installer.rb:578:in `validate_targets'

    /usr/local/Cellar/cocoapods/1.7.4/libexec/gems/cocoapods-1.7.4/lib/cocoapods/installer.rb:158:in `install!'

    /usr/local/Cellar/cocoapods/1.7.4/libexec/gems/cocoapods-1.7.4/lib/cocoapods/command/install.rb:51:in `run'

    /usr/local/Cellar/cocoapods/1.7.4/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'

    /usr/local/Cellar/cocoapods/1.7.4/libexec/gems/cocoapods-1.7.4/lib/cocoapods/command.rb:52:in `run'

    /usr/local/Cellar/cocoapods/1.7.4/libexec/gems/cocoapods-1.7.4/bin/pod:55:in `<top (required)>'

    /usr/local/Cellar/cocoapods/1.7.4/libexec/bin/pod:22:in `load'

    /usr/local/Cellar/cocoapods/1.7.4/libexec/bin/pod:22:in `<main>'



Error output from CocoaPods:

↳



    [!] `<PBXGroup UUID=`97C146E51CF9000F007C117D`>` attempted to initialize an object with an unknown UUID. `CF3B75C9A7D2FA2A4C99F110` for attribute: `children`. This can be the result of a merge and

    the unknown UUID is being discarded.



    [!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See

    `https://guides.cocoapods.org/syntax/podfile.html#platform`.



Error running pod install

Error launching application on iPhone Xʀ.

A problem occurred configuring project ':flutter_document_picker'

Hi,

A problem occurred configuring project ':flutter_document_picker'.
> Failed to notify project evaluation listener.
   > java.lang.AbstractMethodError (no error message)

On flutter run. Was happening on a larger project. Happens on a new project as well.

flutter doctor -v:

[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.13.6 17G65, locale en-US)
    • Flutter version 0.9.4 at /Users/x/dev/tools/flutter
    • Framework revision f37c235c32 (5 weeks ago), 2018-09-25 17:45:40 -0400
    • Engine revision 74625aed32
    • Dart version 2.1.0-dev.5.0.flutter-a2eb050044

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/x/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.2.1)
    • IntelliJ at /Users/x/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 29.1.2
    • Dart plugin version 182.3911.37

[✓] Connected devices (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

Any ideas?

Opening document from Google Drive may cause app to crash

I discovered an edge case where opening a file from Google Drive may cause the plugin to crash. I believe this has to do with filename characters which are valid on the Drive platform but invalid on the local platform.

Repro steps: (Android)

  1. Create/upload/rename a file on Google Drive with filename containing at least an Android filename reserved character. For example: Report_2018/12/08.txt
    ( / being the offending character on Android but valid on Drive)

  2. Open the document using the plugin from a Flutter app. App crashes with
    java.lang.RuntimeException: An error occurred while executing doInBackground()
    ...
    Caused by: java.io.FileNotFoundException: /data/user/0/com.example.myapp/cache/Report_2018/12/08.txt (No such file or directory)

Expected behavior:
Plugin should return a sanitized path after opening the document.

Thanks in advance and keep up the good work.

Reply already submitted FATAL EXCEPTION

Getting exception after following process:

Import file via flutter_document_picker -> copy file to local storage -> open file via open_file package... Implemented your package as described in your demo... Any ideas?

Many thanks in advance!

D/AndroidRuntime(14260): Shutting down VM E/AndroidRuntime(14260): FATAL EXCEPTION: main E/AndroidRuntime(14260): Process: at.pockethouse.app.appfrontenduserpockethouse, PID: 14260 E/AndroidRuntime(14260): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=3241360, result=-1, data=null} to activity {at.pockethouse.app.appfrontenduserpockethouse/at.pockethouse.app.appfrontenduserpockethouse.MainActivity}: java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime(14260): at android.app.ActivityThread.deliverResults(ActivityThread.java:3680) E/AndroidRuntime(14260): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3723) E/AndroidRuntime(14260): at android.app.ActivityThread.access$1300(ActivityThread.java:156) E/AndroidRuntime(14260): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1400) E/AndroidRuntime(14260): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(14260): at android.os.Looper.loop(Looper.java:211) E/AndroidRuntime(14260): at android.app.ActivityThread.main(ActivityThread.java:5389) E/AndroidRuntime(14260): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(14260): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(14260): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020) E/AndroidRuntime(14260): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815) E/AndroidRuntime(14260): Caused by: java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime(14260): at io.flutter.view.FlutterNativeView$1.reply(FlutterNativeView.java:174) E/AndroidRuntime(14260): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:194) E/AndroidRuntime(14260): at com.sidlatau.flutterdocumentpicker.FlutterDocumentPickerDelegate.onActivityResult(FlutterDocumentPickerDelegate.kt:62) E/AndroidRuntime(14260): at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:210) E/AndroidRuntime(14260): at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:139) E/AndroidRuntime(14260): at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:138) E/AndroidRuntime(14260): at android.app.Activity.dispatchActivityResult(Activity.java:6192) E/AndroidRuntime(14260): at android.app.ActivityThread.deliverResults(ActivityThread.java:3676) E/AndroidRuntime(14260): ... 10 more I/Process (14260): Sending signal. PID: 14260 SIG: 9 Lost connection to device.

Unable to use 1.4.0 for IOS

I am using release 1.4.0. It's working fine with android however I am getting. following error while building IOS app.
/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_document_picker-1.4.0/ios/Classes/FlutterDocumentPickerPlugin.m:2:9: fatal error: 'flutter_document_picker/flutter_document_picker-Swift.h' file not found
#import <flutter_document_picker/flutter_document_picker-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Allow multiple mime types

Hello,
Thanks for this plugin.
Can you add support for multiple mime types instead of only single one?
For example, I would like to filter only pdf and image files (image/*|application/pdf)

Build Error

I'm trying to use your plugin, but after I put its dependency on pubspec.yaml I get the following error.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':flutter_document_picker'.
> Failed to notify project evaluation listener.
   > java.lang.AbstractMethodError (no error message)

Any ideas?
Am I missing any configuration steps?

Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v0.8.5-pre.5, on Microsoft Windows [Version 10.0.17134.285], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[√] Android Studio (version 3.1)
[√] VS Code (version 1.27.2)
[√] Connected devices (1 available)

• No issues found!

method channel

sdk level 3.0

error shown

android\src\main\kotlin\com\sidlatau\flutterdocumentpicker\FlutterDocumentPickerPlugin.kt: (74, 28):
Type mismatch: inferred type is Activity? but Activity was expected

android\src\main\kotlin\com\sidlatau\flutterdocumentpicker\FlutterDocumentPickerPlugin.kt: (86, 33):
Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected

How to choose a directory?

I need to select only a path to a directory with files. Can flutter_document_picker do this? I tried to use the appropriate MIME types, but did not get any result.

Potential Issue with copying Large files to temp directory

Large Files that are copied to temp directory may fill up storage since they're being duplicated. Also, it may not be preferable to copy the files to the temp directory at all times, for example in cases where:

  • the developer wants to edit a file in place,
  • the file is large and will take up too much space,
  • the file is too large to successfully copy,
  • the file will take too long to copy
  • The developer needs the original path location
  • the developer needs to work with other files contained in the same directory or files that the opened file may depend on.

Long story short, can the copying to temp directory be made an optional flag that defaults to true?

EXC_BAD_ACCESS (code=2, address=0x7ffeee88dff8)

after integrating the plugin, my app keeps crushing on ios

Screen Shot 2020-03-24 at 9 06 25 PM

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.15.22-pre.24, on Mac OS X 10.15.3 19D76, locale
    en-VI)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.1)
[✓] VS Code (version 1.43.2)
[✓] Connected device (4 available)

• No issues found!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.