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

Error: "No Image Selected" when select take picture from PHOTOLIBRARY #771

Open
3 tasks done
luongtu996 opened this issue Oct 21, 2021 · 8 comments
Open
3 tasks done

Comments

@luongtu996
Copy link

luongtu996 commented Oct 21, 2021

Bug Report

Problem

It always returns "No Image Selected" when source is PHOTOLIBRARY

What is expected to happen?

when I call getPicture()

import { Camera, CameraOptions } from '@ionic-native/camera/ngx';

constructor(private camera: Camera) {}

async getPicture() {
  const options: CameraOptions = {
    allowEdit: false,
    sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
    destinationType: this.camera.DestinationType.FILE_URI
  };

  try {
    const imagePath = await this.camera.getPicture(options);
    console.log("Success: ", imagePath);
  } catch(e) {
    console.log("Error: ",e);
  }
}

should return a fileURL

What does actually happen?

It always throw error "No Image Selected".

Information

I tested on Android 10. it still worked

Command or Code

Environment, Platform, Device

Device: Xiaomi Redmi note 9 pro
Platform: Android
Version: Android 11

Version information

Ionic:

   Ionic CLI                     : 6.17.1 (.../.nvm/versions/node/v14.17.1/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.8.4
   @angular-devkit/build-angular : 12.1.4
   @angular-devkit/schematics    : 12.2.10
   @angular/cli                  : 12.2.10
   @ionic/angular-toolkit        : 4.0.0

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : android 10.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 5 other plugins)

Utility:

   cordova-res                          : 0.15.3
   native-run (update available: 1.5.0) : 1.4.0

System:

   Android SDK Tools : 26.1.1 (.../Library/Android/sdk)
   ios-deploy        : 1.11.4
   ios-sim           : ios-sim/9.0.0 darwin-x64 node-v14.17.1
   NodeJS            : v14.17.1 (.../.nvm/versions/node/v14.17.1/bin/node)
   npm               : 7.19.0
   OS                : macOS Big Sur
   Xcode             : Xcode 13.0 Build version 13A233

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@iPwa97
Copy link

iPwa97 commented Nov 3, 2021

Same Problem.

@gidiChernyakov
Copy link

I guess it happens on all Android 11 MIUI phones?
Same on:
Device: Xiaomi Redmi Note 10s
Platform: Android
Version: Android 11
MIUI Version: 12.5.13

@iPwa97
Copy link

iPwa97 commented Nov 4, 2021

I guess it happens on all Android 11 MIUI phones? Same on: Device: Xiaomi Redmi Note 10s Platform: Android Version: Android 11 MIUI Version: 12.5.13

i try it on same MIUI version on XIAOMI Mi 10T Pro 5G

//Edit same problem on samsung devices

@iPwa97
Copy link

iPwa97 commented Nov 8, 2021

has anyone success with the issue?

@wsq12345
Copy link

Add the following line to your config.xml: <preference name="AndroidLaunchMode" value="singleTop" />

@iPwa97
Copy link

iPwa97 commented Nov 12, 2021

Add the following line to your config.xml: <preference name="AndroidLaunchMode" value="singleTop" />

in my case, same problem with the line. :(

@geshub
Copy link

geshub commented Jan 31, 2022

Any news on that one ? Got the same problem on Xiami Mi 11 with MIUI 12.5.5 Android 11.
App is targeting SDK 30

@geshub
Copy link

geshub commented Feb 3, 2022

@iPwa97 @gidiChernyakov If you've got this problem on Xiaomi device, do you have MIUI optimization option turned off on your Developer options ?
In my case the bug go away if I turn on that option.
It may not be a problem for regular users then ?

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

5 participants