lisen87 / image_pickers

图片多选并压缩,保存图片到相册,视频多选,预览图片和视频
Apache License 2.0
90 stars 59 forks source link

选择图片闪退,不是必现,但是出现机率很大 #117

Open 743306400 opened 1 year ago

743306400 commented 1 year ago
image
lisen87 commented 1 year ago

看这个问题是线程问题,但是原生代码中并没有使用子线程回调flutter。我使用 flutter 3.7和3.10测试,安卓9/13,都没有复现这个问题。你那边flutter 版本是多少?手机的安卓版本,型号等也提供一下。

743306400 commented 1 year ago

看这个问题是线程问题,但是原生代码中并没有使用子线程回调flutter。我使用 flutter 3.7和3.10测试,安卓9/13,都没有复现这个问题。你那边flutter 版本是多少?手机的安卓版本,型号等也提供一下。

flutter版本: 2.10.0 手机型号: OPPO K5 ColorsOs 版本: V11.1 Android版本: Android 11

lisen87 commented 1 year ago

flutter版本: 2.10.0 ? 建议更新一下 flutter。

看这个问题是线程问题,但是原生代码中并没有使用子线程回调flutter。我使用 flutter 3.7和3.10测试,安卓9/13,都没有复现这个问题。你那边flutter 版本是多少?手机的安卓版本,型号等也提供一下。

flutter版本: 2.10.0 手机型号: OPPO K5 ColorsOs 版本: V11.1 Android版本: Android 11

flutter版本: 2.10.0 ? 建议更新一下 flutter。

DaYang816 commented 11 months ago

楼主我碰到一个闪退,说我缺了什么东西么,不管是相机还是选图片,现在我机子必定闪退。。T T

I/Timeline(30542): Timeline: Activity_launch_request time:961952734
W/ActivityThread(30542): handleWindowVisibility: no activity for token android.os.BinderProxy@42c9e58
D/ViewContentFactory(30542): initViewContentFetcherClass
I/ContentCatcher(30542): ViewContentFetcher : ViewContentFetcher
D/ViewContentFactory(30542): createInterceptor took 0ms
D/ForceDarkHelper(30542): updateByCheckExcludeList: pkg: com.yongjiang.airobot activity: com.leeson.image_pickers.activitys.SelectPicsActivity@ec4e070
I/chatty  (30542): uid=10607(com.yongjiang.airobot) identical 1 line
D/ForceDarkHelper(30542): updateByCheckExcludeList: pkg: com.yongjiang.airobot activity: com.leeson.image_pickers.activitys.SelectPicsActivity@ec4e070
D/AndroidRuntime(30542): Shutting down VM
E/AndroidRuntime(30542): FATAL EXCEPTION: main
E/AndroidRuntime(30542): Process: com.yongjiang.airobot, PID: 30542
E/AndroidRuntime(30542): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yongjiang.airobot/com.leeson.image_pickers.activitys.SelectPicsActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
E/AndroidRuntime(30542):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308)
E/AndroidRuntime(30542):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457)
E/AndroidRuntime(30542):    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
E/AndroidRuntime(30542):    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(30542):    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(30542):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)
E/AndroidRuntime(30542):    at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(30542):    at android.os.Looper.loop(Looper.java:224)
E/AndroidRuntime(30542):    at android.app.ActivityThread.main(ActivityThread.java:7562)
E/AndroidRuntime(30542):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(30542):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/AndroidRuntime(30542):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
E/AndroidRuntime(30542): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
E/AndroidRuntime(30542):    at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:852)
E/AndroidRuntime(30542):    at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:815)
E/AndroidRuntime(30542):    at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:703)
E/AndroidRuntime(30542):    at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
E/AndroidRuntime(30542):    at com.leeson.image_pickers.activitys.SelectPicsActivity.onCreate(SelectPicsActivity.java:75)
E/AndroidRuntime(30542):    at android.app.Activity.performCreate(Activity.java:7893)
E/AndroidRuntime(30542):    at android.app.Activity.performCreate(Activity.java:7880)
E/AndroidRuntime(30542):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
E/AndroidRuntime(30542):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283)
E/AndroidRuntime(30542):    ... 11 more
I/Process (30542): Sending signal. PID: 30542 SIG: 9
Lost connection to device.

Exited.
lisen87 commented 11 months ago

在你的 AndroidManifest.xml 中application  标签下 添加 tools:replace="android:theme"试试

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年12月11日(星期一) 上午10:18 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [lisen87/image_pickers] 选择图片闪退,不是必现,但是出现机率很大 (Issue #117)

楼主我碰到一个闪退,说我缺了什么东西么 I/Timeline(30542): Timeline: Activity_launch_request time:961952734 W/ActivityThread(30542): handleWindowVisibility: no activity for token @. D/ViewContentFactory(30542): initViewContentFetcherClass I/ContentCatcher(30542): ViewContentFetcher : ViewContentFetcher D/ViewContentFactory(30542): createInterceptor took 0ms D/ForceDarkHelper(30542): updateByCheckExcludeList: pkg: com.yongjiang.airobot activity: @. I/chatty (30542): uid=10607(com.yongjiang.airobot) identical 1 line D/ForceDarkHelper(30542): updateByCheckExcludeList: pkg: com.yongjiang.airobot activity: @. D/AndroidRuntime(30542): Shutting down VM E/AndroidRuntime(30542): FATAL EXCEPTION: main E/AndroidRuntime(30542): Process: com.yongjiang.airobot, PID: 30542 E/AndroidRuntime(30542): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yongjiang.airobot/com.leeson.image_pickers.activitys.SelectPicsActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. E/AndroidRuntime(30542): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308) E/AndroidRuntime(30542): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457) E/AndroidRuntime(30542): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) E/AndroidRuntime(30542): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) E/AndroidRuntime(30542): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) E/AndroidRuntime(30542): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044) E/AndroidRuntime(30542): at android.os.Handler.dispatchMessage(Handler.java:107) E/AndroidRuntime(30542): at android.os.Looper.loop(Looper.java:224) E/AndroidRuntime(30542): at android.app.ActivityThread.main(ActivityThread.java:7562) E/AndroidRuntime(30542): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(30542): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) E/AndroidRuntime(30542): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) E/AndroidRuntime(30542): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. E/AndroidRuntime(30542): at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:852) E/AndroidRuntime(30542): at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:815) E/AndroidRuntime(30542): at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:703) E/AndroidRuntime(30542): at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195) E/AndroidRuntime(30542): at com.leeson.image_pickers.activitys.SelectPicsActivity.onCreate(SelectPicsActivity.java:75) E/AndroidRuntime(30542): at android.app.Activity.performCreate(Activity.java:7893) E/AndroidRuntime(30542): at android.app.Activity.performCreate(Activity.java:7880) E/AndroidRuntime(30542): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) E/AndroidRuntime(30542): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283) E/AndroidRuntime(30542): ... 11 more I/Process (30542): Sending signal. PID: 30542 SIG: 9 Lost connection to device. Exited.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID:
@.>

DaYang816 commented 11 months ago
    <application
        android:label="测试"
        android:name="${applicationName}"
        tools:replace="android:theme"
        android:icon="@mipmap/ic_launcher">

报错

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
E:\flutterDemo\ces\android\app\src\main\AndroidManifest.xml:14:5-47:19 Error:
    tools:replace specified at line:14 for attribute android:theme, but no new value specified
E:\flutterDemo\ces\android\app\src\main\AndroidManifest.xml Error:
    Validation failed, exiting

FAILURE: Build failed with an exception.
lisen87 commented 11 months ago

@.***/AppTheme"

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年12月11日(星期一) 上午10:40 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [lisen87/image_pickers] 选择图片闪退,不是必现,但是出现机率很大 (Issue #117)

 <application         android:label="测试"         android:name="${applicationName}"         tools:replace="android:theme"         ***@***.***/ic_launcher"&gt;  

报错 Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! E:\flutterDemo\ces\android\app\src\main\AndroidManifest.xml:14:5-47:19 Error: tools:replace specified at line:14 for attribute android:theme, but no new value specified E:\flutterDemo\ces\android\app\src\main\AndroidManifest.xml Error: Validation failed, exiting FAILURE: Build failed with an exception.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

lisen87 commented 11 months ago

确保你有个 theme

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年12月11日(星期一) 上午10:40 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [lisen87/image_pickers] 选择图片闪退,不是必现,但是出现机率很大 (Issue #117)

 <application         android:label="测试"         android:name="${applicationName}"         tools:replace="android:theme"         ***@***.***/ic_launcher"&gt;  

报错 Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! E:\flutterDemo\ces\android\app\src\main\AndroidManifest.xml:14:5-47:19 Error: tools:replace specified at line:14 for attribute android:theme, but no new value specified E:\flutterDemo\ces\android\app\src\main\AndroidManifest.xml Error: Validation failed, exiting FAILURE: Build failed with an exception.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

lisen87 commented 11 months ago

image

image

DaYang816 commented 11 months ago

按照楼主的操作了,可以了感谢