Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Error during attachToGLContext #512

Closed
Tom3652 opened this issue Feb 11, 2022 · 6 comments
Labels
fixed Issue has been resolved and pull request linked

Comments

@Tom3652
Copy link

Tom3652 commented Feb 11, 2022

Plugin Version

google_mobile_ads: ^1.1.0

Expected results:

The application should not crash.

Actual results:

The application is crashing.
I am using Native Ads only in my project and this has probably something to do while playing videos from Native Ads.

I have made another issue regarding an iOS crash but i was not sure this was this plugin the root cause, and now i have got another crash on Android i start to believe that this might be linked.

The Native Ads are displayed in ListView only if this helps.

Unfortunately i can't reproduce this 100%, but i had not this crash before migrating to Flutter 2.10.

Logs
E/OpenGLRenderer( 9883): [SurfaceTexture-0-9883-29] attachToContext: SurfaceTexture is already attached to a context
E/flutter ( 9883): [ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Error during attachToGLContext (see logcat for details)
E/flutter ( 9883): 	at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:294)
E/flutter ( 9883): 	at io.flutter.embedding.engine.renderer.SurfaceTextureWrapper.attachToGLContext(SurfaceTextureWrapper.java:57)
E/flutter ( 9883): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 9883): 	at android.os.MessageQueue.next(MessageQueue.java:336)
E/flutter ( 9883): 	at android.os.Looper.loop(Looper.java:197)
E/flutter ( 9883): 	at android.app.ActivityThread.main(ActivityThread.java:7948)
E/flutter ( 9883): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 9883): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/flutter ( 9883): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
E/flutter ( 9883):
F/flutter ( 9883): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1301)] Check failed: fml::jni::CheckException(env).
F/libc    ( 9883): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 9883 (appname.android), pid 9883 (appname.android)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: ‘samsung/a10eea/a10:10/QP1A.190711.020/A105FNXXS6BUB1:user/release-keys’
Revision: ‘5’
ABI: ‘arm’
Timestamp: 2022-02-11 15:03:15+0100
pid: 9883, tid: 9883, name: appname.android  >>> com.myappname.android <<<
uid: 10407
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: ‘[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1301)] Check failed: fml::jni::CheckException(env).
’
    r0  00000000  r1  0000269b  r2  00000006  r3  ff89ad10
    r4  ff89ad24  r5  ff89ad08  r6  0000269b  r7  0000016b
    r8  ff89ad20  r9  ff89ad10  r10 ff89ad40  r11 ff89ad30
    ip  0000269b  sp  ff89ace0  lr  e8e543b7  pc  e8e543ca
backtrace:
      #00 pc 000603ca  /apex/com.android.runtime/lib/bionic/libc.so (abort+166) (BuildId: 320fbdc2a1289fadd7dacae7f2eb77a3)
      #01 pc 012737ff  /data/app/com.myappname.android-LlO9pATsPrUzpGoEQRnjqw==/base.apk!libflutter.so (offset 0x3ac7000) (BuildId: 136968d93f9253c52c7079d6c72673a47647b578)
[✓] Flutter (Channel stable, 2.10.0, on macOS 12.2 21D49 darwin-x64, locale fr-FR)
    • Flutter version 2.10.0 at /Users/foxtom/Desktop/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5f105a6ca7 (10 days ago), 2022-02-01 14:15:42 -0800
    • Engine revision 776efd2034
    • Dart version 2.16.0
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/foxtom/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-7590822)
    • 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-7590822)

[✓] VS Code (version 1.63.2)
    • VS Code at /Users/foxtom/Desktop/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 12.2 21D49 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 98.0.4758.80

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

• No issues found!
@droplet-js
Copy link

any news update?

@maheshj01 maheshj01 added the in triage Issue currently being evaluated label Feb 14, 2022
@maheshj01
Copy link
Collaborator

Hi @Tom3652, Thanks for filing the issue. I am quite not sure if this is related to ads, Could you please share your pubspec.yaml, There have been similar reports of this issue flutter/flutter#98155 and #511, and is very likely fixed on the flutter master channel.

@maheshj01 maheshj01 added the feedback required Further information is requested label Feb 14, 2022
@Tom3652
Copy link
Author

Tom3652 commented Feb 14, 2022

Hi @maheshmnj thanks for your reply.
Actually you are probably right, i just saw platform_view and i had implemented it for native ads so i thought about it directly, but i am indeed using video_player in my app (not webview_flutter).
And as said in the provided issue, it only happened in flutter 2.10 indeed :)

@github-actions github-actions bot removed the feedback required Further information is requested label Feb 14, 2022
@maheshj01
Copy link
Collaborator

@Tom3652 can you please verify if this is reproducible on the master channel as the above-linked issue seems to be fixed?

@maheshj01 maheshj01 added the feedback required Further information is requested label Feb 15, 2022
@Tom3652
Copy link
Author

Tom3652 commented Feb 21, 2022

Well i didn't get the error since then and using flutter: 2.10.2 now, however i am also not using native ads for now either because of other unwanted behaviors in my app, not related to this issue.
So either the problem indeed comes from native ads and the issue may still exists for now, or not and the issue is solved.
I will update when i put back native ads

@github-actions github-actions bot removed the feedback required Further information is requested label Feb 21, 2022
@maheshj01
Copy link
Collaborator

I am going to close this issue since the above-linked issue was merged to master and you are no longer able to reproduce the issue. Feel free to comment on this issue again or file a new issue in case you still reproduce it.

@maheshj01 maheshj01 added fixed Issue has been resolved and pull request linked and removed in triage Issue currently being evaluated labels Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Issue has been resolved and pull request linked
Projects
None yet
Development

No branches or pull requests

3 participants