Closed venus-yangbo closed 1 year ago
麻烦 从github上下载源码,运行一下试试,看看会不会出现这个问题?
------------------ 原始邮件 ------------------ 发件人: "lisen87/image_pickers" @.>; 发送时间: 2023年11月16日(星期四) 上午10:19 @.>; @.***>; 主题: [lisen87/image_pickers] Android选择图片闪退,必现 (Issue #127)
Flutter:stable 3.7.12 image_pickers:^2.0.2闪退,升级到^2.0.4+2(实测引用为2.0.4+5)依旧 Android:
compileSdkVersion 34
targetSdkVersion 34
ext.kotlin_version = '1.8.0'
classpath 'com.android.tools.build:gradle:7.1.2'
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
(33也依旧闪退)
使用方式: List<Media> imagePaths = await ImagePickers.pickerPaths( language: Language.chinese, galleryMode: GalleryMode.image, selectCount: 9, showCamera: true, uiConfig: UIConfig(uiThemeColor: Colors.black), cropConfig: CropConfig( enableCrop: false, width: 2, height: 1, ), );
flutter run -v
[ +17 ms] D/AndroidRuntime( 4826): Shutting down VM [ +2 ms] E/AndroidRuntime( 4826): FATAL EXCEPTION: main [ ] E/AndroidRuntime( 4826): Process: com.lly.testapp, PID: 4826 [ ] E/AndroidRuntime( 4826): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lly.test/com.leeson.image_pickers.activitys.SelectPicsActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3717) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3874) [ ] E/AndroidRuntime( 4826): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) [ ] E/AndroidRuntime( 4826): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) [ ] E/AndroidRuntime( 4826): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2256) [ ] E/AndroidRuntime( 4826): at android.os.Handler.dispatchMessage(Handler.java:106) [ ] E/AndroidRuntime( 4826): at android.os.Looper.loopOnce(Looper.java:201) [ ] E/AndroidRuntime( 4826): at android.os.Looper.loop(Looper.java:288) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.main(ActivityThread.java:7993) [ ] E/AndroidRuntime( 4826): at java.lang.reflect.Method.invoke(Native Method) [ ] E/AndroidRuntime( 4826): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) [ ] E/AndroidRuntime( 4826): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028) [ ] E/AndroidRuntime( 4826): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:852) [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:815) [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:703) [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195) [ ] E/AndroidRuntime( 4826): at com.leeson.image_pickers.activitys.SelectPicsActivity.onCreate(SelectPicsActivity.java:75) [ ] E/AndroidRuntime( 4826): at android.app.Activity.performCreate(Activity.java:8054) [ ] E/AndroidRuntime( 4826): at android.app.Activity.performCreate(Activity.java:8034) [ ] E/AndroidRuntime( 4826): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1341) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3698) [ ] E/AndroidRuntime( 4826): ... 12 more [ +173 ms] I/Process ( 4826): Sending signal. PID: 4826 SIG: 9 [ +80 ms] Service protocol connection closed. [ ] Lost connection to device. [ +1 ms] DevFS: Deleting filesystem on the device (file:///data/user/0/com.lly.test/code_cache/testappTKKHNV/testapp/) [ +253 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed [ +4 ms] "flutter run" took 986,922ms. [ +173 ms] ensureAnalyticsSent: 170ms [ ] Running 1 shutdown hook [ +1 ms] Shutdown hooks complete [ ] exiting with code 0
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
麻烦 从github上下载源码,运行一下试试,看看会不会出现这个问题? … ------------------ 原始邮件 ------------------ 发件人: "lisen87/image_pickers" @.>; 发送时间: 2023年11月16日(星期四) 上午10:19 @.>; @.>; 主题: [lisen87/image_pickers] Android选择图片闪退,必现 (Issue #127) Flutter:stable 3.7.12 image_pickers:^2.0.2闪退,升级到^2.0.4+2(实测引用为2.0.4+5)依旧 Android: compileSdkVersion 34 targetSdkVersion 34 ext.kotlin_version = '1.8.0' classpath 'com.android.tools.build:gradle:7.1.2' distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip (33也依旧闪退) 使用方式: List<Media> imagePaths = await ImagePickers.pickerPaths( language: Language.chinese, galleryMode: GalleryMode.image, selectCount: 9, showCamera: true, uiConfig: UIConfig(uiThemeColor: Colors.black), cropConfig: CropConfig( enableCrop: false, width: 2, height: 1, ), ); flutter run -v [ +17 ms] D/AndroidRuntime( 4826): Shutting down VM [ +2 ms] E/AndroidRuntime( 4826): FATAL EXCEPTION: main [ ] E/AndroidRuntime( 4826): Process: com.lly.testapp, PID: 4826 [ ] E/AndroidRuntime( 4826): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lly.test/com.leeson.image_pickers.activitys.SelectPicsActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3717) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3874) [ ] E/AndroidRuntime( 4826): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) [ ] E/AndroidRuntime( 4826): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) [ ] E/AndroidRuntime( 4826): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2256) [ ] E/AndroidRuntime( 4826): at android.os.Handler.dispatchMessage(Handler.java:106) [ ] E/AndroidRuntime( 4826): at android.os.Looper.loopOnce(Looper.java:201) [ ] E/AndroidRuntime( 4826): at android.os.Looper.loop(Looper.java:288) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.main(ActivityThread.java:7993) [ ] E/AndroidRuntime( 4826): at java.lang.reflect.Method.invoke(Native Method) [ ] E/AndroidRuntime( 4826): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) [ ] E/AndroidRuntime( 4826): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028) [ ] E/AndroidRuntime( 4826): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:852) [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:815) [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:703) [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195) [ ] E/AndroidRuntime( 4826): at com.leeson.image_pickers.activitys.SelectPicsActivity.onCreate(SelectPicsActivity.java:75) [ ] E/AndroidRuntime( 4826): at android.app.Activity.performCreate(Activity.java:8054) [ ] E/AndroidRuntime( 4826): at android.app.Activity.performCreate(Activity.java:8034) [ ] E/AndroidRuntime( 4826): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1341) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3698) [ ] E/AndroidRuntime( 4826): ... 12 more [ +173 ms] I/Process ( 4826): Sending signal. PID: 4826 SIG: 9 [ +80 ms] Service protocol connection closed. [ ] Lost connection to device. [ +1 ms] DevFS: Deleting filesystem on the device (file:///data/user/0/com.lly.test/code_cache/testappTKKHNV/testapp/) [ +253 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed [ +4 ms] "flutter run" took 986,922ms. [ +173 ms] ensureAnalyticsSent: 170ms [ ] Running 1 shutdown hook [ +1 ms] Shutdown hooks complete [ ] exiting with code 0 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>
pubspec.yaml
:
image_pickers:
git:
url: https://github.com/lisen87/image_pickers.git
尝试后依旧闪退,看了下,报错原因与之前一致。
不是这这样测试的,是直接 从 https://github.com/lisen87/image_pickers.git 下载下来源码,然后运行源码 测试一下。
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月16日(星期四) 下午5:17 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [lisen87/image_pickers] Android选择图片闪退,必现 (Issue #127)
麻烦 从github上下载源码,运行一下试试,看看会不会出现这个问题? … ------------------ 原始邮件 ------------------ 发件人: "lisen87/image_pickers" @.>; 发送时间: 2023年11月16日(星期四) 上午10:19 @.>; @.>; 主题: [lisen87/image_pickers] Android选择图片闪退,必现 (Issue #127) Flutter:stable 3.7.12 image_pickers:^2.0.2闪退,升级到^2.0.4+2(实测引用为2.0.4+5)依旧 Android: compileSdkVersion 34 targetSdkVersion 34 ext.kotlin_version = '1.8.0' classpath 'com.android.tools.build:gradle:7.1.2' distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip (33也依旧闪退) 使用方式: List<Media> imagePaths = await ImagePickers.pickerPaths( language: Language.chinese, galleryMode: GalleryMode.image, selectCount: 9, showCamera: true, uiConfig: UIConfig(uiThemeColor: Colors.black), cropConfig: CropConfig( enableCrop: false, width: 2, height: 1, ), ); flutter run -v [ +17 ms] D/AndroidRuntime( 4826): Shutting down VM [ +2 ms] E/AndroidRuntime( 4826): FATAL EXCEPTION: main [ ] E/AndroidRuntime( 4826): Process: com.lly.testapp, PID: 4826 [ ] E/AndroidRuntime( 4826): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lly.test/com.leeson.image_pickers.activitys.SelectPicsActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3717) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3874) [ ] E/AndroidRuntime( 4826): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) [ ] E/AndroidRuntime( 4826): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) [ ] E/AndroidRuntime( 4826): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2256) [ ] E/AndroidRuntime( 4826): at android.os.Handler.dispatchMessage(Handler.java:106) [ ] E/AndroidRuntime( 4826): at android.os.Looper.loopOnce(Looper.java:201) [ ] E/AndroidRuntime( 4826): at android.os.Looper.loop(Looper.java:288) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.main(ActivityThread.java:7993) [ ] E/AndroidRuntime( 4826): at java.lang.reflect.Method.invoke(Native Method) [ ] E/AndroidRuntime( 4826): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) [ ] E/AndroidRuntime( 4826): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028) [ ] E/AndroidRuntime( 4826): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:852) [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:815) [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:703) [ ] E/AndroidRuntime( 4826): at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195) [ ] E/AndroidRuntime( 4826): at com.leeson.image_pickers.activitys.SelectPicsActivity.onCreate(SelectPicsActivity.java:75) [ ] E/AndroidRuntime( 4826): at android.app.Activity.performCreate(Activity.java:8054) [ ] E/AndroidRuntime( 4826): at android.app.Activity.performCreate(Activity.java:8034) [ ] E/AndroidRuntime( 4826): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1341) [ ] E/AndroidRuntime( 4826): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3698) [ ] E/AndroidRuntime( 4826): ... 12 more [ +173 ms] I/Process ( 4826): Sending signal. PID: 4826 SIG: 9 [ +80 ms] Service protocol connection closed. [ ] Lost connection to device. [ +1 ms] DevFS: Deleting filesystem on the device (file:///data/user/0/com.lly.test/code_cache/testappTKKHNV/testapp/) [ +253 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed [ +4 ms] "flutter run" took 986,922ms. [ +173 ms] ensureAnalyticsSent: 170ms [ ] Running 1 shutdown hook [ +1 ms] Shutdown hooks complete [ ] exiting with code 0 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>
pubspec.yaml: image_pickers: git: url: https://github.com/lisen87/image_pickers.git
尝试后依旧闪退,看了下,报错原因与之前一致。
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
这个不应该出现这个theme问题的,是不是有其他原生的代码,将theme修改了?
example
没跑起来😂,应该是网络问题。先换插件实现了,后面有其他兄弟也遇到了再打开吧。
Exception in thread "main" java.net.ConnectException: Connection timed out: connect
at java.base/java.net.PlainSocketImpl.connect0(Native Method)
at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:609)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:305)
at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:373)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:203)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:189)
at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2787)
at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2699)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1854)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'... 22.7s
Exception: Gradle task assembleDebug failed with exit code 1
这个不应该出现这个theme问题的,是不是有其他原生的代码,将theme修改了?
有可能,我为了集成CodeGather/flutter_ali_auth
跟fluttercandies/flutter_ali_auth
,顺便把依赖跟版本啥的调整了下。不确定是不是这个有关,你可以尝试下。
之前一直用^2.0.2
没出现啥问题。
Flutter:
stable 3.7.12
image_pickers:^2.0.2
闪退,升级到^2.0.4+2
(实测引用为2.0.4+5
)依旧 Android:compileSdkVersion 34
targetSdkVersion 34
ext.kotlin_version = '1.8.0'
classpath 'com.android.tools.build:gradle:7.1.2'
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
使用方式:
flutter run -v