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

Failed to setup Skia Gr context #11094

Closed
simusco opened this issue Jul 6, 2017 · 29 comments
Closed

Failed to setup Skia Gr context #11094

simusco opened this issue Jul 6, 2017 · 29 comments

Comments

@simusco
Copy link

simusco commented Jul 6, 2017

Launching lib\main.dart on Samsung Galaxy S6, 5 1 0, API 22, 1440x2560 in debug mode...
Built build\app/outputs/apk/app-debug.apk (21.7MB).
I/flutter ( 1942): [INFO:gpu_surface_gl.cc(51)] Failed to setup Skia Gr context.
Application finished.

@eseidelGoogle
Copy link
Contributor

@simusco is this an emulator?

@chinmaygarde or @brianosman what are the right instructions for how to gather the right GPU information here?

@brianosman
Copy link

Is this reproducible? That error suggests that just creating the GrContext is failing, which limits how much information you can scrape from within Flutter - typically you would ask the GrContext. We do test Skia on that device - it's got a relatively recent Mali GPU (T7xx).

@programadorthi
Copy link

Here is happening the same error. I just has created the getting started myapp.

Flutter install the application in my emulator but it freeze in the black screen.

I am using Windows 10 Pro and Android Emulator Samsung Galaxy Tab API 17.

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running 'gradle assembleDebug'...
Built build\app/outputs/apk/app-debug.apk (21.7MB).
Installing build\app/outputs/apk/app.apk... 2.1s
I/flutter ( 3002): [INFO:gpu_surface_gl.cc(51)] Failed to setup Skia Gr context.
Syncing files to device Android SDK built for x86... 1.5s

In my Nexus 5X API 25 emulator it works very well.

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running 'gradle assembleDebug'... 2.0s
Built build\app/outputs/apk/app-debug.apk (21.7MB).
Installing build\app/outputs/apk/app.apk... 1.6s
I/Choreographer( 4441): Skipped 67 frames! The application may be doing too much work on its main thread.
D/EGL_emulation( 4441): eglMakeCurrent: 0xa89855a0: ver 2 0 (tinfo 0xa8983e70)
Syncing files to device Android SDK built for x86... 2.0s

@mzimmerm
Copy link

I am getting the same error in emulator:

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running 'gradle assembleDebug'...
Built build/app/outputs/apk/app-debug.apk (21.6MB).
I/flutter ( 2243): [INFO:gpu_surface_gl.cc(51)] Failed to setup Skia Gr context.
Syncing files to device Android SDK built for x86...

This is when launching the demo flutter app (counter), using API level 17, hardware emulation. The application shows completely black after this error. When I change to API level 24, the application works

@eseidelGoogle
Copy link
Contributor

This is the kind of bug where something like #11402 might be useful. :)

@mzimmerm
Copy link

I guess. BTW, I do not mind this issue at all as long as some SDKs work for me in emulation (and some do). Found this googling and wanted to add it does not seem unique for the reporter. Thanks.

@ljfreelancer88
Copy link

I encountered the same issue in emulator and able to fixed by changing the configuration in AVD. Under Emulated Perfomance, set Graphics to Hardware - GLES 2.0

@zarinfam
Copy link

zarinfam commented Mar 4, 2018

I am using Windows 10 Pro and I have the same problem on Android Emulator API level 17.

@MartinTello
Copy link

I am using Windows 10 Education and I have the same problem on Android Emulator API level 16.

@eseidelGoogle
Copy link
Contributor

flutter run --enable-software-rendering should work as a work-around. CC @mit-mit, @cbracken @chinmaygarde I thought that we had decided to make Android Emulators default to software rendering? (I can't seem to find the issue tracking that)?

@MartinTello
Copy link

@eseidelGoogle that work, i just find it in #9108

@argenisdlopez
Copy link

argenisdlopez commented Mar 11, 2018

Jajaja I had the same problem , I created my virtual machine and ran the test drive from this url https://flutter.io/get-started/test-drive/#androidsstudio but not worked in android studio , I had write the option --enable-software-rendering and it works!!!. Why not works like in the official documentation? @eseidel

@chinmaygarde
Copy link
Member

Filed #15451 to track whether we should flip the defaults on software rendering on emulators.

@Keshava11
Copy link

For Android Studio or IntelliJ users, this is same as what @eseidelGoogle suggested

  1. from command line
    $ <in_project_root> flutter run --enable-software-rendering

  2. from Run/Edit configurations menu in IDE
    flutterrun_additional_args

@aymentoumi
Copy link

For Visual Studio Code users add the following line to launch.json :
"args": ["--enable-software-rendering", "-d", "all"]

@chinmaygarde
Copy link
Member

@aymentoumi: Thanks for the pointer. Though I don't think "-d all" is related to software rendering.

@aymentoumi
Copy link

@chinmaygarde "-d all" means all devices and it's optional if you use only one emulator.

@zabih-alipour
Copy link

Thanks @eseidelGoogle, I have same problem and solved

@cbracken
Copy link
Member

Closing this for the moment; the remainder should be covered by #15451. We recently updated startup messages for Android emulator runs to help clarify how to switch between software and hardware rendering as well.

@josvos
Copy link

josvos commented Sep 6, 2018

Just as an update for watchers of this closed issue: see also issue #18601, the problem also/still occurs on physical (older) devices. For more details see my last comment in issue #18601.

@nvminhtu
Copy link

For Visual Studio Code users add the following line to launch.json :
"args": ["--enable-software-rendering", "-d", "all"]

or run command line:

flutter run --enable-software-rendering

Both of them work for me. Thanks all!

@garfnadeck
Copy link

flutter run --enable-software-rendering should work as a work-around. CC @mit-mit, @cbracken @chinmaygarde I thought that we had decided to make Android Emulators default to software rendering? (I can't seem to find the issue tracking that)?

Thank you very much my friend :)

@pengchunlin
Copy link

For Android Studio or IntelliJ users, this is same as what @eseidelGoogle suggested

  1. from command line
    $ <in_project_root> flutter run --enable-software-rendering
  2. from Run/Edit configurations menu in IDE
    flutterrun_additional_args

not work for me

@cswxzx
Copy link

cswxzx commented Jan 8, 2020

I have same problem

@fzyzcjy
Copy link
Contributor

fzyzcjy commented Jan 23, 2020

Hi, I have the problem with a real machine (not Android simulator) bought in 2017 (which is not too old). Thus, why my phone do not support hardware rendering? Will this harm performance? Will many phones do not support hardware rendering, so that Flutter apps will crash on them?? Thanks!

@elmissouri16
Copy link

enable software rendering can be a workaround for debugging but how about release mode ??

@BREN0-MORAIS
Copy link

Para usuários do Visual Studio Code, adicione a seguinte linha ao launch.json :
"args": ["--enable-software-rendering", "-d", "all"]

ou execute a linha de comando:

flutter run --enable-software-rendering

Ambos trabalham para mim. Obrigado a todos!

Obrigado me Ajudo

@jasonrichdarmawan
Copy link

flutter run --enable-software-rendering should work as a work-around. CC @mit-mit, @cbracken @chinmaygarde I thought that we had decided to make Android Emulators default to software rendering? (I can't seem to find the issue tracking that)?

Hi, I need to support API 16. It seems this issue present in API 16 (Google APIs) and API 19 (Google APIs).

Is there recommended way to build the apk with --enable-software-rendering with flutter command. Thank you.

Reference to possible solution

@github-actions
Copy link

github-actions bot commented Aug 6, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests