Issues with Snapcraft and Flutter in a Parallels VM

Hi,
I’m new to Snapcraft.
Currently I’m experimenting with Flutter and I’m thinking about how to deploy my application for each platform I want to support.
For Linux it is quite obvious to use snapcraft for that.

Thanks to the online examples getting the creation of the snap package going is really straight forward but now I encounter some problems and I’m not sure where to start.

I create the application and the snap package is generated without any problems or warnings. I can install the application fine but when I run it, I get errors regarding OpenGL initialization:

➜  snapcraft_showcase git:(main) flutter-snap-app 
/home/mlamers/Documents was removed, reassigning DOCUMENTS to homedir
/home/mlamers/Music was removed, reassigning MUSIC to homedir
/home/mlamers/Pictures was removed, reassigning PICTURES to homedir
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[ERROR:flutter/shell/gpu/gpu_surface_gl_delegate.cc(89)] Could not create a valid GL interface.
[ERROR:flutter/shell/platform/embedder/embedder_surface_gl.cc(94)] Internal error: Resource context available but could not create a compatible Skia context.
[ERROR:flutter/shell/gpu/gpu_surface_gl_delegate.cc(89)] Could not create a valid GL interface.
[ERROR:flutter/shell/gpu/gpu_surface_gl.cc(53)] Failed to set up Skia Gr context.
[ERROR:flutter/shell/common/platform_view.cc(85)] Failed to create platform view rendering surface
No provider of glGenVertexArrays found.  Requires one of:
    Desktop OpenGL 3.0
    GL extension "GL_ARB_vertex_array_object"
    OpenGL ES 3.0
    GL extension "GL_APPLE_vertex_array_object"
    GL extension "GL_OES_vertex_array_object"
[1]    28491 abort (core dumped)  flutter-snap-app

Googling that error leads to Nvidia driver issues so my assumption now is that this error has something to do with the fact that I run the application in my VM.
But if that is the problem (I didn’t have a chance to verify that on a real Linux machine) then wouldn’t that mean that my snap package (that is independent from the system, that’s the whole point) won’t run in VMs? (At least the VMs that are as mine?)

Does anyone have experience regarding that or can point me into a direction for how to solve that?
I’m even not sure if this is a problem of snap, the Flutter plugin or Flutter itself.

I have Ubuntu 18.04 running in that VM.
I already tried snapcraft beta (because I thought that might pull in a newer Plugin version) but that doesn’t change anything.

Here is the source code of an example application I made to rule out that my application is part of the problem:


It is just the default Flutter app extended by a snapcraft.yaml

Thanks for your help!