shijingsh / react-native-customized-image-picker

iOS/Android image picker with support for camera, video compression, multiple images and cropping
245 stars 59 forks source link

Images aren't shown in gallery android #112

Open poPaTheGuru opened 2 years ago

poPaTheGuru commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

poPaTheGuru commented 2 years ago

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

YMalikk commented 2 years ago

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

dipotechnologies commented 2 years ago

I am having this issue, any solutions yet

hpsurekha commented 2 years ago

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 commented 2 years ago

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

jbrainz commented 2 years ago

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

liukefu2050 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

I ended up using another library.

matrixTechy commented 2 years ago

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 commented 2 years ago

@matrixTechy Please try the example application

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

liukefu2050 commented 2 years ago

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

dvisescu commented 2 years ago

@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 commented 2 years ago

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 commented 4 months ago

I ended up using another library.

Do you mind sharing which library you use?

indev-aj commented 4 months ago

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

Do you mind sharing which library do you use?