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

Fix a crash on some android device with the error message "EGL Error: EGL_BAD_MATCH" #6358

Conversation

kangwang1988
Copy link
Contributor

We met a crash on one android device with the error message below:

E/flutter (29807): [ERROR:flutter/shell/platform/android/android_context_gl.cc(187)] Could not create an EGL context
E/flutter (29807): [ERROR:flutter/shell/platform/android/android_context_gl.cc(53)] EGL Error: EGL_BAD_MATCH (12297)
I/DEBUG   (29807): begin to generate native report

This pr handles the certain case and enable flutter work normally in those devices.

Environment:

KyleWongdeMacBook-Pro:src kylewong$ flutter doctor -v
[✓] Flutter (Channel alf_beta_v0.8.2_snapshot, v0.8.3-pre.5, on Mac OS X 10.14 18A389, locale en-CN)
    • Flutter version 0.8.3-pre.5 at /Users/kylewong/Codes/fwn_idlefish/flutter
    • Framework revision db697e6120 (25 hours ago), 2018-09-26 19:32:39 +0800
    • Engine revision 58a1894a1c
    • Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
    • Android SDK at /Users/kylewong/Library/Android/sdk
    • Android NDK at /Users/kylewong/Library/Android/sdk/ndk-bundle
    • Platform android-28, build-tools 28.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A254a
    • ios-deploy 1.9.2
    ! CocoaPods out of date (1.5.0 is recommended).
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.io/platform-plugins
      To upgrade:
        brew upgrade cocoapods
        pod setup

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 27.1.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Connected devices (1 available)
    • HUAWEI P6 T00 • 022BTF7N44035887 • android-arm • Android 4.2.2 (API 17)

! Doctor found issues in 1 category.

The HUAWEI P6 T00 is the one that crashes and fixed using this commit.
It has informations below:
2
1

"
[ERROR:flutter/shell/platform/android/android_context_gl.cc(187)] Could not create an EGL context
[ERROR:flutter/shell/platform/android/android_context_gl.cc(53)] EGL Error: EGL_BAD_MATCH (12297)
"
@kangwang1988 kangwang1988 changed the title Fix a crash on some android device with the error message below: Fix a crash on some android device with the error message "EGL Error: EGL_BAD_MATCH" Sep 27, 2018
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flutter will be unable to use textures created using async texture upload. This will lead to some textures being black or populated with garbage data on devices with this error.

We should disable the async texture upload mechanism altogether on such devices.

@kangwang1988
Copy link
Contributor Author

@chinmaygarde
I'm not clear about all the call sites where the "async texture upload mechanism" is used.
So in you opinion, if I want to make the async/sync mechanism optional, what files/functions should I pay attention to?

@chinmaygarde
Copy link
Member

@kangwang1988 I am attempting to rework the rasterizer to be resilient to such limitations as it does not appear to be a straightforward patch. But this is definitely a limitation we should handle gracefully.

@chinmaygarde
Copy link
Member

I filed flutter/flutter#22527 to track progress on the fix.

@kf6gpe
Copy link
Contributor

kf6gpe commented Nov 7, 2018

@chinmaygarde Should we wait until you resolve flutter/flutter/#22527 and pick up that fix instead of this one?

@cbracken
Copy link
Member

@kangwang1988 thanks for your contribution. Given that I don't expect #22527 to land in the immediate future, I'm going to close this PR for now. Once that bug has been resolved, let's take another look at this.

@cbracken cbracken closed this Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants