question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:6

github_iconTop GitHub Comments

1reaction
maheshmnjcommented, Feb 22, 2022

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.

1reaction
maheshmnjcommented, Feb 14, 2022

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 https://github.com/flutter/flutter/issues/98155 and https://github.com/googleads/googleads-mobile-flutter/issues/511, and is very likely fixed on the flutter master channel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flutter : VideoPlayer carshing - dart - Stack Overflow
[ERROR:flutter/shell/platform/android/platform_view_android_jni_impl.cc(43)] java.lang.RuntimeException: Error during attachToGLContext (see ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found