gpt4 book ai didi

android - flutter image_cropper 崩溃

转载 作者:行者123 更新时间:2023-12-04 23:53:45 25 4
gpt4 key购买 nike

我尝试使用此插件裁剪图像,并且在 iOS 上运行良好,但在 Android 上,应用程序会崩溃。控制台是这样说的。

V/BoostFramework(22266): mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[]) V/BoostFramework(22266): mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease() V/BoostFramework(22266): mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[]) V/BoostFramework(22266): mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String) V/BoostFramework(22266): mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop() V/BoostFramework(22266): BoostFramework() : mPerf = com.qualcomm.qti.Performance@544293f W/art (22266): Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable D/BitmapLoadUtils(22266): maxBitmapSize: 2078 D/BitmapWorkerTask(22266): Uri scheme: file E/TransformImageView(22266): onFailure: setImageUri E/TransformImageView(22266): java.io.FileNotFoundException: Permission denied E/TransformImageView(22266): at android.os.Parcel.openFileDescriptor(Native Method) E/TransformImageView(22266): at android.os.ParcelFileDescriptor.openInternal(ParcelFileDescriptor.java:283) E/TransformImageView(22266): at android.os.ParcelFileDescriptor.open(ParcelFileDescriptor.java:200) E/TransformImageView(22266): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:981) E/TransformImageView(22266): at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:839) E/TransformImageView(22266): at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:793) E/TransformImageView(22266): at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:100) E/TransformImageView(22266): at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:44) E/TransformImageView(22266): at android.os.AsyncTask$2.call(AsyncTask.java:305) E/TransformImageView(22266): at java.util.concurrent.FutureTask.run(FutureTask.java:237) E/TransformImageView(22266): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243) E/TransformImageView(22266): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) E/TransformImageView(22266): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) E/TransformImageView(22266): at java.lang.Thread.run(Thread.java:761) E/AndroidRuntime(22266): FATAL EXCEPTION: main E/AndroidRuntime(22266): Process: com.example.droidemo, PID: 22266 E/AndroidRuntime(22266): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=69, result=96, data=Intent { (has extras) }} to activity {com.example.droidemo/com.example.droidemo.MainActivity}: java.lang.IllegalArgumentException: Unsupported value: java.io.FileNotFoundException: Permission denied E/AndroidRuntime(22266): at android.app.ActivityThread.deliverResults(ActivityThread.java:4211) E/AndroidRuntime(22266): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4254) E/AndroidRuntime(22266): at android.app.ActivityThread.-wrap20(ActivityThread.java) E/AndroidRuntime(22266): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1584) E/AndroidRuntime(22266): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(22266): at android.os.Looper.loop(Looper.java:154) E/AndroidRuntime(22266): at android.app.ActivityThread.main(ActivityThread.java:6242) E/AndroidRuntime(22266): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(22266): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) E/AndroidRuntime(22266): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) E/AndroidRuntime(22266): Caused by: java.lang.IllegalArgumentException: Unsupported value: java.io.FileNotFoundException: Permission denied E/AndroidRuntime(22266): at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:293) E/AndroidRuntime(22266): at io.flutter.plugin.common.StandardMethodCodec.encodeErrorEnvelope(StandardMethodCodec.java:70) E/AndroidRuntime(22266): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:208) E/AndroidRuntime(22266): at vn.hunghd.flutter.plugins.imagecropper.ImageCropperDelegate.finishWithError(ImageCropperDelegate.java:99) E/AndroidRuntime(22266): at vn.hunghd.flutter.plugins.imagecropper.ImageCropperDelegate.onActivityResult(ImageCropperDelegate.java:82) E/AndroidRuntime(22266): at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:210) E/AndroidRuntime(22266): at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:139) E/AndroidRuntime(22266): at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:138) E/AndroidRuntime(22266): at android.app.Activity.dispatchActivityResult(Activity.java:7009) E/AndroidRuntime(22266): at android.app.ActivityThread.deliverResults(ActivityThread.java:4207) E/AndroidRuntime(22266): ... 9 more Lost connection to device. Exited (sigterm)

有谁知道如何解决这个问题?

最佳答案

在 Android 平台上,我们需要将 UCropActivity 配置到应用程序下方的 AndroidManifest.xml 中。 IOS 不需要这样做。

阅读详情:https://pub.dev/packages/image_cropper

<activity             
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

关于android - flutter image_cropper 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53757742/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com