Joe Sleiman Joe Sleiman - 8 months ago 111
AngularJS Question

ionic android : when choose image from gallery the app crash

When I click on

choose file(input="file")
to choose an image from gallery , after select the image on android the app crash , and also on ios (iphone).
I already add the permissions on the androidmanifest.xml:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" />


and still not working.

Answer Source

I was getting the same issue in iOS. Try adding these data to info.plist

<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera.</string>

For android can you share the logcat output.

  1. How are you building the app, if you don't have Android Studio? Are you using phonegap?
  2. If you have Android Studio, then a tool Monitor is pre installed with Android Studio. When you open Monitor, then the logs for the app can be seen

If phonegap is used, can u share the id, I can take a look if you want

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download