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.

Cropper crashes after selecting a picture and transitioning to crop view. - Android 9 (Pie)

See original GitHub issue

No Error message is given but the app crashes in the transition and returns to the screen it was on before the image-cropper is initiated.

`profilePicture?.setOnClickListener { Log.d(“CreateProfileFrag”,“Open picture selection”)

        //crop image to circle
        if (context != null) {
            CropImage.activity()
                    .setGuidelines(CropImageView.Guidelines.ON)
                    .setCropShape(CropImageView.CropShape.OVAL)
                    .start(activity!!)
        }
    }`

The cropper continues to work on lower versions of android. <=8 (Oreo)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:10

github_iconTop GitHub Comments

1reaction
VuHongKycommented, Mar 27, 2019

Full fix here: On CropOverlayView, search and change two following places: Place 1:

               if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                    canvas.clipOutPath(mPath);
                    canvas.clipOutRect(rect);
                } else {
                    canvas.clipPath(mPath, Region.Op.INTERSECT);
                    canvas.clipRect(rect, Region.Op.XOR);
                }

Place 2:

           if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                canvas.clipOutPath(mPath);
            } else {
                canvas.clipPath(mPath, Region.Op.XOR);
            }

At the moment, I had to download zip file to local and import to my project, and fix it myself. Hope admin will fix it as soon as possible.

1reaction
marco97pacommented, Sep 25, 2018

I hope this will be fixed soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash after Image Crop when updated OS Version to 5.1.1
I have same problem. The new CROP action doesn't use method onActivityResult(). Resolution: copy file to folder where you want to save cropped...
Read more >
Detect and diagnose crashes - Android Developers
When an app crashes, Android terminates the app's process and displays a dialog to let the user know that the app has stopped,...
Read more >
How to Crop an Image in Android (with ActivityResultContracts)
In this video you will learn how you can crop an image in Android using a custom ActivityResultContract.⭐ Get certificates for your future ......
Read more >
Crop images in Illustrator - Adobe Support
The Crop Image feature works only on the currently selected image. Also, linked images become embedded after you crop them.
Read more >
Flutter Gems - A Curated List of Top Dart and Flutter packages
Flutter Gems is a curated list of top Dart and Flutter packages that are categorized based on functionality. Flutter Gems is also a...
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