Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

The Image Gallery is not showing any images on Android 10 (API 29) #102

Open
nafre opened this issue Feb 21, 2020 · 8 comments
Open

The Image Gallery is not showing any images on Android 10 (API 29) #102

nafre opened this issue Feb 21, 2020 · 8 comments

Comments

@nafre
Copy link

nafre commented Feb 21, 2020

Describe the bug
On Android 10 (API 29), I ran the demo from this repo and the results for the ImagePicker is as shown in the picture below. I have provided the app with all the permissions needed.
Screenshot_20200221-151310_demo
As you can see, the images are not showing up.

To Reproduce
Steps to reproduce the behavior:
Try running this plugin on Samsung 10 or API level 29

Expected behavior
The application should work as it should by showing the gallery and the camera as well.

NativeScript Info(please run tns info):

tns info
√ Getting NativeScript components versions information...
‼ Update available for component nativescript. Your current version is 6.1.2 and the latest available version is 6.4.0.
‼ Update available for component tns-core-modules. Your current version is 6.1.2 and the latest available version is 6.4.1.
‼ Update available for component tns-android. Your current version is 6.1.1 and the latest available version is 6.4.1.
‼ Update available for component tns-ios. Your current version is 6.1.1 and the latest available version is 6.4.2.

Sample Code(please provide minimum code to reproduce problem):
The code is from the demo which can be found in this repository.

@jibon57
Copy link
Owner

jibon57 commented Feb 21, 2020

@nafre Have you tried to add android:requestLegacyExternalStorage="true" ?

<application
		android:name="com.tns.NativeScriptApplication"
		android:allowBackup="true"
		android:icon="@drawable/icon"
		android:label="@string/app_name"
		android:theme="@style/AppTheme"
		android:requestLegacyExternalStorage="true">

@nafre
Copy link
Author

nafre commented Feb 21, 2020

I just tried the method above and it worked. Thanks.

@nafre nafre closed this as completed Feb 21, 2020
@jibon57 jibon57 changed the title The Image Gallery is not showing any images on Samsung Note 10 The Image Gallery is not showing any images on Android 10 (API 29) Feb 28, 2020
@jibon57 jibon57 reopened this Feb 28, 2020
@hugops
Copy link

hugops commented Jul 2, 2020

Hi, I had problems doing this procedure. The images are displayed, but when I try to record a video this error appears.

System.err: An uncaught Exception occurred on "main" thread. System.err: MIME type video/mp4 cannot be inserted into content://media/external/images/media; expected MIME type under image/* System.err: System.err: StackTrace: System.err: java.lang.IllegalArgumentException: MIME type video/mp4 cannot be inserted into content://media/external/images/media; expected MIME type under image/* System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:170) System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140) System.err: at android.content.ContentProviderProxy.insert(ContentProviderNative.java:481) System.err: at android.content.ContentResolver.insert(ContentResolver.java:1835) System.err: at com.vincent.filepicker.adapter.VideoPickAdapter$1.onClick(VideoPickAdapter.java:96) System.err: at android.view.View.performClick(View.java:7870) System.err: at android.view.View.performClickInternal(View.java:7839) System.err: at android.view.View.access$3600(View.java:886) System.err: at android.view.View$PerformClick.run(View.java:29363) System.err: at android.os.Handler.handleCallback(Handler.java:883) System.err: at android.os.Handler.dispatchMessage(Handler.java:100) System.err: at android.os.Looper.loop(Looper.java:237) System.err: at android.app.ActivityThread.main(ActivityThread.java:7857) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

if remove android:requestLegacyExternalStorage="true" I can open the video recorder, but the images do not showing

@mreall
Copy link

mreall commented Aug 1, 2020

I'm having the same problem as @hugops. Has anyone figured out a workaround?

@hugops
Copy link

hugops commented Aug 3, 2020

I fork the android project https://github.com/hugops/MultiType-FilePicker, and fixed the bugs. After i generate the aar lib and replace the file in node-modules path (node_modules/nativescript-mediafilepicker/platforms/android/MultiTypeFilePicker-release.aar) to work in my project

@xpalacincreditoh
Copy link

But in android 11 sdk 30 not works

@meightythree
Copy link

meightythree commented Oct 26, 2021

Android 11 SDK 30 still does not list files in Documents or Downloads folder.

Name: pixel_5_api_30
CPU/ABI: Google APIs Intel Atom (x86)
Path: C:\Users\user.android\avd\Pixel_5_API_30.avd
Target: google_apis [Google APIs] (API level 30)
image.androidVersion.api: 30

@xpalacincreditoh
Copy link

I have the same error with SDK 30

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants