DmcSDK / cordova-plugin-mediaPicker

cordova android ios mediaPicker support selection of multiple image and video gif ✨ cordova android 和 ios 图片视频选择cordova插件,支持多图 视频 gif,ui类似微信
MIT License
139 stars 93 forks source link

Does not display images on android #110

Closed jahn-brito closed 4 years ago

jahn-brito commented 4 years ago

Hello, when I try to select the photos they do not appear on my device. As in the image below:

Screenshot_2020-06-04-09-51-33-198_br com smartbabypais

My code:

var args = {
      'selectMode': 100, //101=picker image and video , 100=image , 102=video
      'maxSelectCount': 10 - state.photos.length, //default 40 (Optional)
      'maxSelectSize': 188743680, //188743680=180M (Optional) 
    };

MediaPicker.getMedias(args, function (medias) {
        for (var i = 0; i < medias.length; i++) {
          medias[i].quality = 50; //when the value is 100,return original image
          MediaPicker.compressImage(medias[i], function (compressData) {
            console.log("openFilePickerActivity -> compressData", compressData)
            //user compressData.path upload compress img
            console.log(compressData.path);
            var imgObj = {
              id: compressData.index,
              co90File: '',
              fileUrl: compressData.uri,
            }
            //Adiciona no array de photos para enviar
            state.photos.push(imgObj);
            state.edited = true;
            var photosCount = state.photos.length;
            refreshCount();

            if (photosCount === 10) {
              verifyLimitOfFiles();
            }
            mountDivImage();
          }, function (e) { console.log(e) });
        }
      }, function (e) { console.log(e) })

My AndroidManifest.xml

<uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-feature android:name="android.hardware.location.gps" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.DELETE_CACHE_FILES" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
    <permission android:name="br.com.smartbabypais.permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="br.com.smartbabypais.permission.RECEIVE_ADM_MESSAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
jahn-brito commented 4 years ago

I solved my problem with this change in config.xml

I change:

<preference name="android-targetSdkVersion" value="29" />

to:

<preference name="android-targetSdkVersion" value="28" />

font

secretmoo35 commented 4 years ago

New Google Play Policy Upload on Google Play Store, Target Sdk version 29 must be set, causing Android X to be unavailable this plugin.

Is there a way to fix it?

Mr-Anonymous commented 4 years ago

New Google Play Policy Upload on Google Play Store, Target Sdk version 29 must be set, causing Android X to be unavailable this plugin.

Is there a way to fix it?

Maybe you should create a separate issue for this since this one is closed and can get lost.