Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images aren't shown in gallery android #112

Open
poPaTheGuru opened this issue Aug 17, 2021 · 19 comments
Open

Images aren't shown in gallery android #112

poPaTheGuru opened this issue Aug 17, 2021 · 19 comments

Comments

@poPaTheGuru
Copy link

I am trying to pick images from gallery (the same for both multiple or single) but when it opens the gallery, it's empty.
If I try to change the folder, it shows the number of photos and a thumbnail of the last photo, but when i open it, is empty.
This is happening only on android, on iOS is working well.
I have all the required permissions in my AndroidManifest.xml and Info.plist

Also, when i open the gallery it kills my application if I don't set imageLoader: 'UNIVERSAL', but I don't know if that might be the problem.

image

@poPaTheGuru
Copy link
Author

poPaTheGuru commented Aug 18, 2021

I have found an older issue that was resolved, but it seems that somehow it came back.

I also tried the solution from there, and it didn't worked.

Here is the issue: https://github.com/shijingsh/react-native-customized-image-picker/issues/90

@Pyroboomka
Copy link

Pyroboomka commented Aug 30, 2021

Same issue for me after bumping targetSDKVersion to 30, because newly published apps since August require targetSDK 30, and updates to existing app will require targetSDK 30 in November.
What I did to working app:

  1. Bumped targetSDK to 30
  2. Bumped complileSDK to 30
  3. Kept requestLegacyExternalStorage line in manifest file.

Android 10 seems to be working fine; However, on Android 11 no permissions are being asked, no gallery content is visible, taking images from camera/cropping is not working too.
Seems like it requires fixes in underlying RXGallery, so bad luck :(

@RasikBhil
Copy link

any update on this ?
facing same issue in android 11. working fine with android 10.

@poPaTheGuru
Copy link
Author

I used another library after all :(
sorry that I can't help

@YMalikk
Copy link

YMalikk commented Oct 31, 2021

This package crash on Android 11 , i resolve this problem by :
Adding imageLoader: 'UNIVERSAL' to openPicker params

@dipotechnologies
Copy link

I am having this issue, any solutions yet

@hpsurekha
Copy link

hpsurekha commented Nov 24, 2021

Does anyone find the solution for this?
I am also facing the same issue in Android 11. After compiling the build with SDK - 30, it stops working in Android 10.
below is the configuration of my grade file.

ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 19
        compileSdkVersion = 30
        targetSdkVersion = 30
        androidXCore = "1.0.2"
    }

Eagerly waiting for a solution, Please update the existing library with Android 11 configurations.

PS: Adding imageLoader: 'UNIVERSAL' to openPicker params
this is not working for me.

@hpsurekha
Copy link

@ALL does anyone find any solution for this?
@shijingsh, can you please look into this and update the library.

@jbrainz
Copy link

jbrainz commented Dec 16, 2021

any updates on this, i'm facing the same issue.

@liukefu2050
Copy link
Collaborator

liukefu2050 commented Jan 13, 2022

fixed it on v1.3.2
make sure:

 buildToolsVersion = "30.0.2"
 compileSdkVersion = 30
 targetSdkVersion = 30

  repositories {
       google()
       jcenter()
       mavenCentral()
       maven { url "https://jitpack.io" }
   }

add permission

   <uses-permission android:name="android.permission.CAMERA" />

   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

add requestLegacyExternalStorage and ScopedStorage

 <application
   ...
   android:requestLegacyExternalStorage="true"
   android:theme="@style/AppTheme">
   ...
     <meta-data android:name="ScopedStorage" android:value="true" />
   
 </application>

@ton21
Copy link

ton21 commented Jan 25, 2022

After updating to v1.3.2 now is crashing on Android 11.
Setting imageLoader: 'UNIVERSAL' does not solve it either.
Does somebody has another suggestion?

Thanks!

@ton21
Copy link

ton21 commented Jan 25, 2022

I ended up using another library.

@matrixTechy
Copy link

fixed it on v1.3.2 make sure:

 buildToolsVersion = "30.0.2"
 compileSdkVersion = 30
 targetSdkVersion = 30

  repositories {
       google()
       jcenter()
       mavenCentral()
       maven { url "https://jitpack.io" }
   }

add permission

   <uses-permission android:name="android.permission.CAMERA" />

   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

add requestLegacyExternalStorage and ScopedStorage

 <application
   ...
   android:requestLegacyExternalStorage="true"
   android:theme="@style/AppTheme">
   ...
     <meta-data android:name="ScopedStorage" android:value="true" />
   
 </application>

Hi.I added what you said to my code.But gallery not showing images.You can help me

@liukefu2050
Copy link
Collaborator

@matrixTechy Please try the example application

https://github.com/shijingsh/pickExample.git

@liukefu2050
Copy link
Collaborator

@ton21 Whether the error stack can be provided, I'm sorry, there is no sufficient test

@dvisescu
Copy link

@liukefu2050 It requires fixes in underlying RXGallery

in MediaUtils.java -> Cursor cursor = contentResolver.query(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection.toArray(new String[projection.size()]), selection,
selectionArgs, MediaStore.Images.Media.DATE_ADDED + " DESC LIMIT " + limit + " OFFSET " + offset);

throws java.lang.IllegalArgumentException: Invalid token LIMIT
https://stackoverflow.com/questions/66280961/contentresolver-query-method-throws-invalid-token-limit-error

@hpsurekha
Copy link

fixed it on v1.3.2 make sure:

 buildToolsVersion = "30.0.2"
 compileSdkVersion = 30
 targetSdkVersion = 30

  repositories {
       google()
       jcenter()
       mavenCentral()
       maven { url "https://jitpack.io" }
   }

add permission

   <uses-permission android:name="android.permission.CAMERA" />

   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

add requestLegacyExternalStorage and ScopedStorage

 <application
   ...
   android:requestLegacyExternalStorage="true"
   android:theme="@style/AppTheme">
   ...
     <meta-data android:name="ScopedStorage" android:value="true" />
   
 </application>

@liukefu2050 I have done the same thing, but the gallery does not show any images.
Please help if any thing else we need to change.

@indev-aj
Copy link

I ended up using another library.

Do you mind sharing which library you use?

@indev-aj
Copy link

I used another library after all :(
sorry that I can't help

Do you mind sharing which library do you use?

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

No branches or pull requests