Skip to content

Android app crash with IllegalStateExceptionat io.flutter.plugin.platform.PlatformViewsController.initializePlatformViewIfNeeded #191

@SoorajSoman

Description

@SoorajSoman

I have implemented web hook payment method as described in the https://github.com/flutter-stripe/flutter_stripe/blob/main/example/lib/screens/webhook_payment_screen.dart and the payment is working as expected for the 1-2 transaction however if i switch between apps and then click on the payment or some time directly clicking button for payment initialisation, the app is crashing ,this happen when page trying to navigate to payment screen with CardField.When I checked the logs its showing java.lang.IllegalStateException: The Android view returned from PlatformView#getView() was already added to a parent view.

Smartphone / tablet

  • Device: Samsung A30

  • OS: Android 11

  • Device: One plus 6

  • OS: Android 11

  • Device: Mi A1

  • OS: Android 7.1.2

  • Flutter version 2.2.0

Please find the below log for details

EGLNativeWindowType 0x71f3487010 disconnect failed
E/flutter (20051): [ERROR:flutter/shell/platform/android/platform_view_android_jni_impl.cc(49)] java.lang.IllegalStateException: The Android view returned from PlatformView#getView() was already added to a parent view.
E/flutter (20051): at io.flutter.plugin.platform.PlatformViewsController.initializePlatformViewIfNeeded(PlatformViewsController.java:729)
E/flutter (20051): at io.flutter.plugin.platform.PlatformViewsController.onDisplayPlatformView(PlatformViewsController.java:767)
E/flutter (20051): at io.flutter.embedding.engine.FlutterJNI.onDisplayPlatformView(FlutterJNI.java:1195)
E/flutter (20051): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (20051): at android.os.MessageQueue.next(MessageQueue.java:335)
E/flutter (20051): at android.os.Looper.loop(Looper.java:206)
E/flutter (20051): at android.app.ActivityThread.main(ActivityThread.java:8587)
E/flutter (20051): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (20051): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
E/flutter (20051): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
E/flutter (20051):
F/flutter (20051): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1395)] Check failed: CheckException(env).
F/libc (20051): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20051 (ass_canine_demo), pid 20051 (ass_canine_demo)
Build fingerprint: 'samsung/a30sxx/a30s:11/RP1A.200720.012/A307FNXXU2CUF2:user/release-keys'
Revision: '3'
ABI: 'arm64'
Timestamp: 2021-07-08 17:24:35+0530
pid: 20051, tid: 20051, name: ass_canine_demo >>> com.example.first_class_canine_demo <<<
uid: 10376
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1395)] Check failed: CheckException(env).
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1395)] Check failed: CheckException(env).
'
x0 0000000000000000 x1 0000000000004e53 x2 0000000000000006 x3 0000007ff70a5b40
x4 000000730e14f000 x5 000000730e14f000 x6 000000730e14f000 x7 00000000018ec426
x8 00000000000000f0 x9 877cf0d12f186509 x10 0000000000000000 x11 ffffffc0fffffbdf
x12 0000000000000001 x13 0000000000000074 x14 0000000000000000 x15 00001848a5898e04
x16 00000073097b7948 x17 00000073097962d0 x18 000000730dd78000 x19 0000000000004e53
x20 0000000000004e53 x21 00000000ffffffff x22 000000730cb3e500 x23 000000726ed72798
x24 0000000000000294 x25 0000000000000052 x26 0000000000000001 x27 0000007ff70a5e40
x28 0000000000000081 x29 0000007ff70a5bc0
lr 0000007309749ca4 sp 0000007ff70a5b20 pc 0000007309749cd0 pst 0000000000000000
backtrace:
#00 pc 0000000000089cd0 /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 698b6aef520f034a9d40736d477f7a96)
#1 pc 000000000131cb44 /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#2 pc 000000000134081c /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#3 pc 0000000001325bac /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#4 pc 0000000001386c78 /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#5 pc 0000000001377b04 /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#6 pc 000000000137840c /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#7 pc 0000000001378d9c /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#8 pc 0000000001377e74 /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#9 pc 0000000001377c4c /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#10 pc 0000000001378ff4 /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#11 pc 00000000013412e8 /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)
#12 pc 0000000001346478 /data/app/~~QXHyB4O4bTrxuDss3qRk2w==/com.example.first_class_canine_demo-0tcT9N7WDlq9GTiv_DZcFw==/lib/arm64/libflutter.so (BuildId: b4b14558deedcd87bbdaa25abb9a6178c0cb18fa)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions