weta-vn / advance_image_picker

Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotating, cropping, adding sticker/filters.
BSD 3-Clause "New" or "Revised" License
110 stars 49 forks source link

Trying to use the crop on a picture make the app instantly crash #6

Closed VuillaumeGautier closed 3 years ago

VuillaumeGautier commented 3 years ago

Hi ! Whenever I try to use the crop function (button at the bottom left from picture edit), the app goes off instantly.

Tested on 2 different Androids. Kotlin version 1.4.32, Gradle build version 3.5.4 (Testing on higher versions)

Error : (shown as FATAL by the runtime env) E/AndroidRuntime(24167): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=69, result=0, data=null} to activity {fr.henoo.henooapp/fr.henoo.henooapp.MainActivity}: java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime(24167): at android.app.ActivityThread.deliverResults(ActivityThread.java:4338) E/AndroidRuntime(24167): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4381) E/AndroidRuntime(24167): at android.app.ActivityThread.-wrap22(ActivityThread.java) E/AndroidRuntime(24167): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1624) E/AndroidRuntime(24167): at android.os.Handler.dispatchMessage(Handler.java:105) E/AndroidRuntime(24167): at android.os.Looper.loop(Looper.java:156) E/AndroidRuntime(24167): at android.app.ActivityThread.main(ActivityThread.java:6577) E/AndroidRuntime(24167): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(24167): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942) E/AndroidRuntime(24167): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832) E/AndroidRuntime(24167): Caused by: java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime(24167): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:155) E/AndroidRuntime(24167): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:238) E/AndroidRuntime(24167): at vn.hunghd.flutter.plugins.imagecropper.ImageCropperDelegate.onActivityResult(ImageCropperDelegate.java:106) E/AndroidRuntime(24167): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:739) E/AndroidRuntime(24167): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:426) E/AndroidRuntime(24167): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:677) E/AndroidRuntime(24167): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:624) E/AndroidRuntime(24167): at android.app.Activity.dispatchActivityResult(Activity.java:7188) E/AndroidRuntime(24167): at android.app.ActivityThread.deliverResults(ActivityThread.java:4334) E/AndroidRuntime(24167): ... 9 more

weta-vn commented 3 years ago

@VuillaumeGautier Could you show me your android/app/build.gradle and AndroidManifest.xml file, please?

VuillaumeGautier commented 3 years ago

Sure thing ! build.gradle.txt AndroidManifest.xml.txt I tried updating my versions of kotlin and gradle but it didn't fix it. Edit : tried adding the requestLegacyExternalStorage as I didn't do it, it didn't fix the issue.

weta-vn commented 3 years ago

@VuillaumeGautier We're sorry about missing some instructions for android. We updated in v0.0.4+1. Please try again. https://pub.dev/packages/advance_image_picker

`<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="vn.weta.freemarimagepickerexample">

<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="freemarimagepicker_example"
    android:requestLegacyExternalStorage="true"
    android:icon="@mipmap/ic_launcher">
    <activity
        android:name="com.yalantis.ucrop.UCropActivity"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

`

VuillaumeGautier commented 3 years ago

It worked perfectly ! Thanks for the quick response. If you'd like too, you can credit our app in your Readme, it's called Henoo and available only in France for now. We'll include your picker in our next release, keep up the good work !

weta-vn commented 3 years ago

It worked perfectly ! Thanks for the quick response. If you'd like too, you can credit our app in your Readme, it's called Henoo and available only in France for now. We'll include your picker in our next release, keep up the good work ! @VuillaumeGautier Thank you very much. We'll credit your app in our Readme later.