-
Notifications
You must be signed in to change notification settings - Fork 673
Troubleshooting
I'm using FileType.custom
with some extensions (eg. [csv, jpg]
) and the file explorer doesn't respect it by allowing me picking other types.
When custom extensions are passed, those are translated into MIME types, then, an intent is sent to system requesting a file explorer to handle those and let you pick the files with the given restrictions — typically, the native one.
However, some Android OS versions (custom roms) not always have the native file explorer, neither you can't prevent the user to install a 3rd party on its own (such as ES FileExplorer). Those file explorers will mostly be capable to handle the request but not always will (actually, most of times won't) honor the MIME restrictions as they need to implement that feature and there's no way you can play around it. So, there's no warranty that fileExtensions
will be respected and when you experience this issue, before reporting, try on an official emulator and see if it still happens.
So, because of that, either the package would have to throw an error when the user picked extensions that aren't suppose to, or, the developer can add this extra protection on their side which seems the more appropriate as you can iterate over the picked files and display a custom alert or similar.
If for some reason when picking you receive an error telling that permissions are already being request, picker is already active or similar.
Lately, there have been reports that projects that were started prior to Android V2 embedded, may need to update some properties in order to seamless support updated plugins.
Referring to EdwynZN answer on flutter permission handler plugin, following the official instructions to upgrade pre 1.12 Android projects, seem to fix.
Basically if your Android project MainActivity.java
or kt is using io.flutter.app.FlutterActivity or your AndroidManifest.xml
is using io.flutter.app.FlutterActivity or have
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
you'll need to update your Flutter project in order to work with the new Android plugin type system.
If your project fails building due to dependencies missing. Typically this happens with import androidx.lifecycle.DefaultLifecycleObserver;
being not recognized.
Typically this happens because your project isn't fully supporting Android X. Please make sure you have completely migrated to it, by checking the official instructions or you can just check if the requirements below are met.
-
On your project's
android/app/build.gradle
change compileSdkVersion and targetSdkVersion to 28 -
Go to android/gradle.properties file and add the following lines:
android.useAndroidX=true
android.enableJetifier=true
I can't build for iOS. There are some OBJC symbol errors on Xcode or any other weird errors that prevent build to succeed.
This is often a dependency resolution issue due to existing caching. If you can't build for iOS, regardless of the plugin's version, do the following. It's recommended that you do this every now and then and it also get rid of a lot of used space on your machine.
- On
project/ios
folder, runpod deintegrate && rm Podfile.lock && pod install
- On your project folder, run
flutter clean
- Clear the Xcode derived that by running
rm -rf ~/Library/Developer/Xcode/DerivedData
- Open the project with Xcode and also clean by doing
Cmd + Shift + K
I have an issue while picking multiple files from Photos app (gallery)
This plugin uses DKImagePickerController as sub-dependency for multi picks on Photos app because ImagePickerController
from iOS SDK doesn't allow it. Thus, any issue directly related to it, should be filed on its official repo.