Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[image_picker] Android application crashes with google_mobile_ads #97267

@pazhut

Description

@pazhut

Immediately after calling: ImagePicker().pickImage, either with from Camera or from Gallery the app crash and i get the following error message:

E/flutter (26074): [ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: 1.raster
E/flutter (26074): 	at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:1405)
E/flutter (26074): 	at io.flutter.embedding.engine.FlutterJNI.destroyOverlaySurfaces(FlutterJNI.java:1174)
E/flutter (26074): 
F/flutter (26074): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1559)] Check failed: fml::jni::CheckException(env). 
F/libc    (26074): Fatal signal 6 (SIGABRT), code -6 in tid 26190 (1.raster)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'lge/h1_lra_us/h1:7.0/NRD90U/1733911185dd1:user/release-keys'
Revision: '12'
ABI: 'arm64'
pid: 26074, tid: 26190, name: 1.raster  >>> com.kushazik.pack_me <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1559)] Check failed: fml::jni::CheckException(env). 
'
    x0   0000000000000000  x1   000000000000664e  x2   0000000000000006  x3   0000000000000008
    x4   0000000000000109  x5   8000000000000000  x6   000000797d3f0000  x7   0000000000000000
    x8   0000000000000083  x9   ffffffffffffffdf  x10  0000000000000000  x11  0000000000000001
    x12  ffffffffffffffff  x13  0000000000000000  x14  0000000000000000  x15  0005b0cdad4327f2
    x16  0000007979b0eed0  x17  0000007979ab8378  x18  0000000071f6d8f8  x19  000000793fde94f8
    x20  0000000000000006  x21  000000793fde9450  x22  0000000000000000  x23  0000007929db0318
    x24  0000000000000044  x25  0000000000000000  x26  000000793fde9198  x27  0000000000000044
    x28  0000000000000001  x29  000000793fde8dc0  x30  0000007979ab5808
    sp   000000793fde8da0  pc   0000007979ab8380  pstate 0000000060000000
backtrace:
    #00 pc 000000000006c380  /system/lib64/libc.so (tgkill+8)
    #01 pc 0000000000069804  /system/lib64/libc.so (pthread_kill+64)
    #02 pc 0000000000024618  /system/lib64/libc.so (raise+24)
    #03 pc 000000000001d034  /system/lib64/libc.so (abort+52)
    #04 pc 0000000000002680  /data/app/com.kushazik.pack_me-2/lib/arm64/libflutter.so (offset 0x1506000)

i am using image_picker plugin version: image_picker: ^0.8.4+5

i had found a link to old post: flutter/plugins@c153033

flutter doctor report:
doctor --verbose

[✓] Flutter (Channel beta, 2.10.0-0.2.pre, on macOS 12.1 21C52 darwin-arm, locale en-CA)
    • Flutter version 2.10.0-0.2.pre at /Users/pazhutmann/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 73adb1406a (6 days ago), 2022-01-19 17:02:56 -0600
    • Engine revision 74b74b10ea
    • Dart version 2.16.0 (build 2.16.0-134.1.beta)
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/pazhutmann/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • RS988 (mobile) • RS98833bcc71e • android-arm64  • Android 7.0 (API 24)
    • Chrome (web)   • chrome        • web-javascript • Google Chrome 97.0.4692.99

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

i hope this can be solved quickly

Thanks much

Metadata

Metadata

Assignees

Labels

c: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowfound in release: 2.10Found to occur in 2.10has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyr: invalidIssue is closed as not valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions