go-flutter-desktop / go-flutter

Flutter on Windows, MacOS and Linux - based on Flutter Embedding, Go and GLFW.
https://hover.build/
BSD 3-Clause "New" or "Revised" License
5.85k stars 283 forks source link

App built on Linux does not run on windows #505

Closed JanezStupar closed 3 years ago

JanezStupar commented 4 years ago

Here is the deal. About a week ago I tried out hover as an alternative build process to the project built in for its advanced packaging support.

The initial test on my app seemed to work well enough, so I started figuring out how to add DLL's and how to handle the plugins I need as app installed on systems with installed VS redist package.

But then I never got to run the result on windows again. I assumed that something is wrong with dependencies until two days ago I decided to step back again and to confirm that tooling works as expected. For the record I am installing app on a virtual machine.

To this end I created a new flutter app using flutter create simple

See the logs below.

Hover doctor

hover: Hover version v0.42.0 running on linux
hover: Sharing flutter version
Flutter 1.21.0-9.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision be9bc8cb39 (3 days ago) • 2020-08-18 09:46:08 -0700
Engine • revision 267070c17a
Tools • Dart 2.10.0 (build 2.10.0-7.2.beta)
hover: Flutter engine commit: https://github.com/flutter/engine/commit/267070c17a6956de1a03dbe09cda56f0c485f41b
hover: Finding out the C compiler version
gcc (GCC) 10.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

hover: Sharing the content of go.mod
module simple/go

go 1.14

require (
        github.com/go-flutter-desktop/go-flutter v0.41.2
        github.com/pkg/errors v0.9.1
)
hover: Sharing the content of hover.yaml
application-name: ""
executable-name: ""
package-name: ""
license: ""
target: lib/main_desktop.dart
branch: ""
cache-path: ""
opengl: ""
engine-version: ""
hover: Sharing the content of go/cmd
go/cmd/main.go  go/cmd/options.go

Hover output

Using hover build [...] --XXX to build my application, I get the following output:

➜  simple hover build windows-msi --docker -v
09:46:41 build.go:290: hover: Cleaning the build directory
09:46:42 build.go:335: hover: Building flutter bundle
Font subetting is not supported in debug mode. The --tree-shake-icons flag will be ignored.
09:46:54 cache.go:229: hover: Using engine from cache
09:46:54 docker.go:44: hover: Compiling go binary using docker container
Running this docker command: /usr/bin/docker run --rm --mount type=bind,source=/home/janez/PycharmProjects/trackself/tmp/hover_demo/simple,target=/app --mount type=bind,source=/home/janez/.cache/hover/engine,target=/root/.cache/hover/engine --mount type=bind,source=/home/janez/.cache/hover/docker-go-cache,target=/go-cache --env GOCACHE=/go-cache --env HOVER_SAFE_CHOWN_UID=1000 --env HOVER_SAFE_CHOWN_GID=1000 --env GOPROXY=https://proxy.golang.org,direct
 --env GOPRIVATE=
 goflutter/hover:v0.42.0 hover-safe.sh build windows-msi --skip-flutter-build-bundle --skip-engine-download
docker container: hover: Compiling 'go-flutter' and plugins
docker container: go: downloading github.com/go-flutter-desktop/go-flutter v0.41.2
docker container: go: extracting github.com/go-flutter-desktop/go-flutter v0.41.2
docker container: go: downloading github.com/Xuanwo/go-locale v0.3.0
docker container: go: downloading golang.org/x/text v0.3.3
docker container: go: downloading github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
docker container: go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2
docker container: go: extracting github.com/Xuanwo/go-locale v0.3.0
docker container: go: downloading github.com/go-ole/go-ole v1.2.4
docker container: go: extracting github.com/go-ole/go-ole v1.2.4
docker container: go: extracting github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2
docker container: go: extracting github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
docker container: go: extracting golang.org/x/text v0.3.3
docker container: go: finding github.com/go-flutter-desktop/go-flutter v0.41.2
docker container: go: finding github.com/Xuanwo/go-locale v0.3.0
docker container: go: finding github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2
docker container: go: finding github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
docker container: go: finding github.com/go-ole/go-ole v1.2.4
docker container: go: finding golang.org/x/text v0.3.3
docker container: hover: Successfully compiled executable binary for windows
docker container: hover: Missing/Empty `author` field in pubspec.yaml. Please add it or otherwise you may publish your app with a wrong author. Continuing with `root` as a placeholder author.
docker container: hover: Missing/Empty `license` field in go/hover.yaml. Please add it or otherwise you may publish your app with a wrong license. Continuing with `NOASSERTION` as a placeholder license.
docker container: hover: Packaging msi in /tmp/hover-build-simple-windows-msi221290933
docker container: hover: Generating dynamic build files
docker container: hover: Cleaning the build directory
docker container: Loading simple.wxs...
docker container: Building simple 1.0.0.msi...
docker container: Writing simple 1.0.0.msi...
09:47:11 docker.go:112: hover: Docker run completed

What are the symptoms you are seeing?

The MSI installer works fine. The application gets successfully installed. But it doesn't run. There is no log entry visible through event viewer. There is no console output when running from cmd, I tried added logging into the dart main method but it seems that the executable doesn't get that far either. The linux build works fine.

So I am a bit lost here, because "it doesn't work" is all I can offer.

So as a first step, I would need some guidance to help me gather more information.

JanezStupar commented 4 years ago

@pchampio @jld3103 @GeertJohan can somebody please give me some pointers how to collect more information?

provokateurin commented 4 years ago

Oh I wrote an answer but it somehow disappeard. Sorry for that. I wrote something like this:

If something works or not it will be useful to debug it further.

JanezStupar commented 4 years ago

I have been busy elsewhere and I expect to provide required feedback in the next couple of days. I am still very much intereseted and invested in getting hover to work for my use case.

JanezStupar commented 3 years ago

Okay so I took some time to do the testing. Turns out that the build works very well. Even with develop channel.

Turns out the issue was that I was trying to run the app in VM. I expected that it will work since the official embedder does.

Feel free to close this issue.

pchampio commented 3 years ago

Duplicate of: https://github.com/go-flutter-desktop/go-flutter/issues/272

You might be able to run it in a vm using: https://github.com/go-flutter-desktop/go-flutter/issues/272#issuecomment-535403717

TheSeriousProgrammer commented 3 years ago

Hi I built the windows-msi package in UBuntu linux I ran the installer in another windows machine I have , it got installed but the app didn't run I got the same issue which @james-lawrence got , not in a vm but a real machine

How do I fix this?

provokateurin commented 3 years ago

Do you have any logs?

TheSeriousProgrammer commented 3 years ago

This is inside a VM , I ran a build cammand with opengl=none arguement , However it didnt work

$ hover run --opengl=none
hover: Using engine from cache
hover: Cleaning the build directory
hover: ⚠ The go-flutter project tries to stay compatible with the beta channel of Flutter.
hover: ⚠     It's advised to use the beta channel: `flutter channel beta`
hover: Bundling flutter app
Running "flutter pub get" in flutter_app...                      1,307ms

 Building with sound null safety

hover: Checking available release on Github
hover: The core library 'go-flutter' has an update available. (v0.42.0 -> 0.43.0)
hover:               To update 'go-flutter' in this project run: `hover bumpversion`
hover: Checking available release on Github
hover: 'hover' has an update available. (v0.46.1 -> 0.46.2)
hover:               To update 'hover' go to `https://github.com/go-flutter-desktop/hover#install` and follow the install steps
hover: The '--opengl=none' flag makes go-flutter incompatible with texture plugins!
hover: Compiling 'go-flutter' and plugins
hover: Successfully compiled executable binary for windows
hover: Build finished, starting app...
hover: Running flutter_app in debug_unopt mode
creating glfw window: APIUnavailable: WGL: The driver does not appear to support OpenGL
hover: App 'flutter_app' exited with error: exit status 1
provokateurin commented 3 years ago

Duplicate of: #272

You might be able to run it in a vm using: #272 (comment)

@pchampio already said everything there is about running in a VM