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

Ucrop crash #42

Closed
harloom opened this issue Nov 14, 2019 · 3 comments
Closed

Ucrop crash #42

harloom opened this issue Nov 14, 2019 · 3 comments
Milestone

Comments

@harloom
Copy link

harloom commented Nov 14, 2019

 ImagePicker.with(this@FromProyekActivity)
        .galleryOnly()    //User can only select image from Gallery
        .cropSquare()
        .compress(1024)
        .start { resultCode, data ->
            if (resultCode == Activity.RESULT_OK) {
                val fileUri = data?.data
                if (fileUri != null) {
                    mViewmodel.renderUpload(fileUri)
                }

                //You can get File object from intent
                val file: File? = ImagePicker.getFile(data)

                //You can also get File Path from intent
                val filePath: String? = ImagePicker.getFilePath(data)
            } else if (resultCode == ImagePicker.RESULT_ERROR) {
                Toast.makeText(
                    this@FromProyekActivity,
                    ImagePicker.getError(data),
                    Toast.LENGTH_SHORT
                ).show()
            } else {
                Toast.makeText(
                    this@FromProyekActivity,
                    "Task Cancelled",
                    Toast.LENGTH_SHORT
                )
                    .show()
            }

        }
Error Code : 
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.zerojump.a18app, PID: 14965
    java.lang.NoSuchMethodError: No virtual method start(Landroid/app/Activity;I)V in class Lcom/yalantis/ucrop/UCrop; or its super classes (declaration of 'com.yalantis.ucrop.UCrop' appears in /data/app/com.zerojump.a18app-to7xY13CNXQhLWgsLJMHvg==/base.apk!classes3.dex)
        at com.github.dhaval2404.imagepicker.provider.CropProvider.cropImage(CropProvider.kt:91)
        at com.github.dhaval2404.imagepicker.provider.CropProvider.startIntent(CropProvider.kt:61)
        at com.github.dhaval2404.imagepicker.ImagePickerActivity.setImage(ImagePickerActivity.kt:116)
        at com.github.dhaval2404.imagepicker.provider.GalleryProvider.handleResult(GalleryProvider.kt:104)
        at com.github.dhaval2404.imagepicker.provider.GalleryProvider.onActivityResult(GalleryProvider.kt:89)
        at com.github.dhaval2404.imagepicker.ImagePickerActivity.onActivityResult(ImagePickerActivity.kt:97)
        at android.app.Activity.dispatchActivityResult(Activity.java:7741)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4724)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4773)
        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:113)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:71)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2034)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:226)
        at android.app.ActivityThread.main(ActivityThread.java:7179)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
@Dhaval2404
Copy link
Owner

@harloom I'm looking into the issue now.
Thank you so much for the feedback. Your feedback helps me to make the app bug free.

@Dhaval2404
Copy link
Owner

@harloom I'm able to reproduce the issue with uCrop 2.2.4.

Can you please downgrade uCrop to v2.2.2 and try again.

implementation 'com.github.yalantis:ucrop:2.2.2'

@Dhaval2404
Copy link
Owner

@harloom Have you tried downgrading uCrop version? does it work for you?

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

2 participants