question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crashes after image selected on Cyanogenmod with cropping

See original GitHub issue

On Cyanogen 12.1.1, Android 5.1.1, after selecting a picture from gallery or taking picture with camera, the app crashes.

My config:

export const uiPicker = {
    title: 'Choose a Picture', // specify null or empty string to remove the title
    cancelButtonTitle: 'Cancel',
    takePhotoButtonTitle: 'Take Photo...', // specify null or empty string to remove this button
    chooseFromLibraryButtonTitle: 'Choose from Library...', // specify null or empty string to remove this button
    cameraType: 'back', // 'front' or 'back'
    mediaType: 'photo', // 'photo' or 'video'
    maxWidth: 800, // photos only
    maxHeight: 800, // photos only
    aspectX: 1, // aspectX:aspectY, the cropping image's ratio of width to height
    aspectY: 1, // aspectX:aspectY, the cropping image's ratio of width to height
    quality: 0.2, // photos only
    angle: 0, // photos only
    allowsEditing: false, // Built in functionality to resize/reposition the image
    noData: false, // photos only - disables the base64 `data` field from being generated (greatly improves performance on large photos)
    storageOptions: { // if this key is provided, the image will get saved in the documents/pictures directory (rather than a temporary directory)
        skipBackup: true, // image will NOT be backed up to icloud
        path: 'images' // will save image at /Documents/images rather than the root
    }
};

The log message in adb:

D/QCameraParameters(  241): int qcamera::QCameraParameters::setAutoRotate(const qcamera::QCameraParameters&) set auto rotate: 0
E/mm-camera(  255): mct_pipeline_process_set:command=800000e
D/QCameraParameters(  241): int32_t qcamera::QCameraParameters::setNumOfSnapshot(): nBurstNum = 1, nExpnum = 1
D/LBSSystemMonitorService(  768): handleMessage what - 4
D/Wiper_jni(  768): Send Network Location.
W/JsonSuggestProvider( 2509): ext: null, mimeType: null, handles: false
D/ApplicationSuggestionService( 2509): handles? false
I/ActivityManager(  768): START u0 {act=com.android.camera.action.CROP dat=file:///data/data/com.cyngn.cameranext/files/crop-temp (has extras)} from uid 10038 on display 0
D/AndroidRuntime(24134): Shutting down VM
E/AndroidRuntime(24134): FATAL EXCEPTION: main
E/AndroidRuntime(24134): Process: com.cyngn.cameranext, PID: 24134
E/AndroidRuntime(24134): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.camera.action.CROP dat=file:///data/data/com.cyngn.cameranext/files/crop-temp (has extras) }
E/AndroidRuntime(24134):        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1781)
E/AndroidRuntime(24134):        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1501)
E/AndroidRuntime(24134):        at android.app.Activity.startActivityForResult(Activity.java:3745)
E/AndroidRuntime(24134):        at android.app.Activity.startActivityForResult(Activity.java:3706)
E/AndroidRuntime(24134):        at com.android.camera.bi.do(SourceFile:1934)
E/AndroidRuntime(24134):        at com.android.camera.cb.onClick(SourceFile:456)
E/AndroidRuntime(24134):        at android.view.View.performClick(View.java:4789)
E/AndroidRuntime(24134):        at com.android.camera.ShutterButton.performClick(SourceFile:149)
E/AndroidRuntime(24134):        at android.view.View$PerformClick.run(View.java:19881)
E/AndroidRuntime(24134):        at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(24134):        at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(24134):        at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(24134):        at android.app.ActivityThread.main(ActivityThread.java:5294)
E/AndroidRuntime(24134):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(24134):        at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(24134):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime(24134):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)


However, if I disable aspectX and aspectY, it works perfectly. So obviously the feature doesn’t exist in cyanogen or it has another name.

Maybe there could be a check in the app, if it is available or not. A crash is a little bit hard.

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yfukscommented, Apr 18, 2016

No response, i close

0reactions
yfukscommented, Apr 6, 2016

I feel like you have an old implementation of the module since com.android.camera.action.CROP isn’t used anymore.

Anyway i push some robustness code that will return the error to react-native if the activity don’t exist. Tell me if that fix the crash for you.

https://github.com/marcshilling/react-native-image-picker/commit/f134b9158cb29144fc12f9112f690c0bdef8ea79#diff-e2ac0feb8ce151bd872a7c4ab6b4801dR230 https://github.com/marcshilling/react-native-image-picker/commit/f134b9158cb29144fc12f9112f690c0bdef8ea79#diff-e2ac0feb8ce151bd872a7c4ab6b4801dR286

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash after Image Crop when updated OS Version to 5.1.1
Above android 5.0 Crop function return URI in onActivityResult so handle it with version of phone accordingly. Bitmap selectedBitmap; if(Build.VERSION.
Read more >
Camera partial crash in CM13 [closed]
After upgrading to CM13, I am unable to capture images using the camera. When I open up the camera app and click an...
Read more >
[Solved] Default image editing crash - XDA Forums
The default image editing application on my Yu Yureka (CM11) is crashing on selecting options like "Looks", "Selective", etc
Read more >
Photo's, video's, whatsapp and gallery problem
When i want to share something from within whatapp it already crashes when selecting ... flashed TWRP 3.0.2.0, rooted the phone and flashed...
Read more >
Troubleshoot crash or freeze in Photoshop - Adobe Support
To quickly determine whether Photoshop is crashing due to a problematic optional or third-party plug-in, do the following: Close Photoshop. Hold ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found