sangcomz / FishBun

:blowfish:FishBun is Image Picker for android.
Apache License 2.0
672 stars 143 forks source link

Permission ACCESS_MEDIA_LOCATION [BUG] #220

Open agnoam opened 3 years ago

agnoam commented 3 years ago

Describe the bug

E/MethodChannel#multi_image_picker(22324): Failed to handle method call
E/MethodChannel#multi_image_picker(22324): java.lang.UnsupportedOperationException: Caller must hold ACCESS_MEDIA_LOCATION permission to access original
E/MethodChannel#multi_image_picker(22324):  at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
E/MethodChannel#multi_image_picker(22324):  at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151)
E/MethodChannel#multi_image_picker(22324):  at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:705)
E/MethodChannel#multi_image_picker(22324):  at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1687)
E/MethodChannel#multi_image_picker(22324):  at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1503)
E/MethodChannel#multi_image_picker(22324):  at android.content.ContentResolver.openInputStream(ContentResolver.java:1187)
E/MethodChannel#multi_image_picker(22324):  at com.vitanov.multiimagepicker.MultiImagePickerPlugin.onMethodCall(MultiImagePickerPlugin.java:299)
E/MethodChannel#multi_image_picker(22324):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:230)
E/MethodChannel#multi_image_picker(22324):  at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#multi_image_picker(22324):  at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/MethodChannel#multi_image_picker(22324):  at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#multi_image_picker(22324):  at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#multi_image_picker(22324):  at android.os.Looper.loop(Looper.java:174)
E/MethodChannel#multi_image_picker(22324):  at android.app.ActivityThread.main(ActivityThread.java:7356)
E/MethodChannel#multi_image_picker(22324):  at java.lang.reflect.Method.invoke(Native Method)

Smartphone:

betranthanh commented 3 years ago

It works for me: Just open the AndroidManifest.xml file, add this attribute to the application tag android:requestLegacyExternalStorage="true"

andesappal commented 2 years ago

It works for me: Just open the AndroidManifest.xml file, add this attribute to the application tag android:requestLegacyExternalStorage="true"

Hi thanks for the tip. Is this the main/AndroidManifest.xml or profile/AndroidManifest.xml? Where exactly in the file should I paste your recommended attribute? Thanks! @betranthanh

andesappal commented 2 years ago

That didn't work for me, I still get 'Permission denied' when trying to access my own phone's gallery. I placed it under <application <activity ... >>

nguyenvanan18031993 commented 1 year ago

It works for me: Just open the AndroidManifest.xml file, add this attribute to the application tag android:requestLegacyExternalStorage="true"

Hi Be, That didn't work for me, I still get 'Permission denied' when trying to access my own phone's gallery.