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

mac systray icon not found in release build. #2

Open
gedw99 opened this issue Oct 16, 2020 · 10 comments
Open

mac systray icon not found in release build. #2

gedw99 opened this issue Oct 16, 2020 · 10 comments

Comments

@gedw99
Copy link

gedw99 commented Oct 16, 2020

Screenshot 2020-10-16 at 18 27 29

It is not easy to see but the ICON in the systray is not there.
In fact it is invisible you will find. So you get tricked into thinking that the systray is not even running.

build:


cd /Users/apple/workspace/go/src/github.com/JanezStupar/flutter_systray/example && flutter build bundle
Font subetting is not supported in debug mode. The --tree-shake-icons flag will be ignored.
cd /Users/apple/workspace/go/src/github.com/JanezStupar/flutter_systray/example && bs-hover build darwin
hover: Missing/Empty `version` field in pubspec.yaml. Please add it or otherwise you may publish your app with a wrong version. Continuing with `0.0.1` as a placeholder version.
hover: Using engine from cache
hover: Cleaning the build directory
hover: Bundling flutter app
Font subetting is not supported in debug mode. The --tree-shake-icons flag will be ignored.
hover: Generating kernel snapshot
hover: Generating ELF snapshot
Warning: Generating ELF library without DWARF debugging information.
hover: Compiling 'go-flutter' and plugins
# flutter_systray_example/go/cmd
ld: warning: dylib (/Users/apple/Library/Caches/hover/engine/darwin-release/libflutter_engine.dylib) was built for newer macOS version (10.11) than being linked (10.10)
hover: Successfully compiled executable binary for darwin

open:

open /Users/apple/workspace/go/src/github.com/JanezStupar/flutter_systray/example/go/build/outputs/darwin-release

Here is the error:

parse main entry: map[iconPath:/Users/apple/go/assets/icon.png title:title]
An error has occurred while parsing the icon: file reading error: open /Users/apple/go/assets/icon.png: no such file or directory

~ /Users/apple/workspace/go/src/github.com/JanezStupar/flutter_systray/example/go/build/outputs/darwin-release/flutter_systray_example ; exit;
go-flutter: WARNING error creating the resource window: VersionUnavailable: NSGL: Failed to create OpenGL context
[ERROR:flutter/shell/platform/embedder/embedder_surface_gl.cc(108)] Could not create a resource context for async texture uploads. Expect degraded performance. Set a valid make_resource_current callback on FlutterOpenGLRendererConfig.
[ERROR:flutter/shell/platform/embedder/embedder_surface_gl.cc(108)] Could not create a resource context for async texture uploads. Expect degraded performance. Set a valid make_resource_current callback on FlutterOpenGLRendererConfig.
go-flutter: calculated pixelRatio limited to a minimum of 1.0. metrics: {"dpi":81.00996677740864,"monitorWidthMm":602,"monitorWidthSc":1920,"mscpi":81.00996677740864,"pixelRatio":0.5063122923588039,"ppsc":1,"windowWidthPx":800,"windowWidthSc":800}
(0x41df080,0xc0000a1080)
parse main entry: map[iconPath:/Users/apple/go/assets/icon.png title:title]
An error has occurred while parsing the icon: file reading error: open /Users/apple/go/assets/icon.png: no such file or directory
2020-10-16 18:25:50.928 flutter_systray_example[81754:2331221] [NSUserNotificationCenter defaultUserNotificationCenter] -> 0x0
go-flutter: no method handler registered for method 'routeUpdated' on channel 'flutter/navigation'
@gedw99 gedw99 changed the title mac systray icon icon not found in release build mac systray icon not found in release build. Oct 16, 2020
@gedw99
Copy link
Author

gedw99 commented Oct 16, 2020

could be shurcools lib.

Upgrade dependency failed: err: exit status 2: stderr: # github.com/go-flutter-desktop/go-flutter/embedder ld: framework not found FlutterEmbedder clang: error: linker command failed with exit code 1 (use -v to see invocation) # github.com/shurcooL/trayhost In file included from ../../shurcooL/trayhost/trayhost.go:20: In file included from ../../shurcooL/trayhost/platform/platform.h:12: ../../shurcooL/trayhost/platform/darwin/tray.m:122:17: warning: 'setImage:' is deprecated: first deprecated in macOS 10.14 - Use the receiver's button.image instead [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSStatusItem.h:74:39: note: property 'image' is declared deprecated here /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSStatusItem.h:74:39: note: 'setImage:' has been exp...

Raised an Issue with him:
shurcooL/trayhost#24

Packaging the example does not solve the problem.
But at least Notifications work :)

@JanezStupar
Copy link
Owner

Interesting... It worked fine when I tested it on my machine. Thanks for feedback. I'll have a look into it.

@JanezStupar
Copy link
Owner

I didn't have time to give it a closer look but this looks like a red flag:
An error has occurred while parsing the icon: file reading error: open /Users/apple/go/assets/icon.png: no such file or directory

This doesn't look like a correct path to me.

@JanezStupar
Copy link
Owner

JanezStupar commented Oct 16, 2020

@gedw99 It seems to me like you ran the project from your user dir -> thus the path resolution in the Flutter example app is wrong.

I think that your issue will be resolved if you run the example from flutter_systray/example directory.

The setImage deprecation warning may indeed be a potential issue. May look into it in the future whenever I am going to be doing more work on this plugin or when it becomes an error.

@gedw99
Copy link
Author

gedw99 commented Oct 17, 2020

Hey @JanezStupar thanks for looking at this.

i did run it from the example dir. See screenshot of bundled release.

Screenshot 2020-10-17 at 06 28 32

Also when you try to use a pkg to install it as a user it fails at the end with an error but no message.
I suspect that might be a hover issue though.

@gedw99
Copy link
Author

gedw99 commented Oct 17, 2020

here is the pkg install error.

Screenshot 2020-10-17 at 06 34 59

@JanezStupar
Copy link
Owner

I have had issues with PKG on my project too, I also suspect its a hover issue but haven't looked into it too much. That's why I am relying on DMG ATM.

Would you be kind enough and let me have hover doctor output?

@gedw99
Copy link
Author

gedw99 commented Oct 18, 2020

sure

hover: Hover version (devel) running on darwin
hover: Sharing flutter version
Flutter 1.22.1 • channel beta • https://github.com/flutter/flutter.git
Framework • revision f30b7f4db9 (9 days ago) • 2020-10-08 10:06:30 -0700
Engine • revision 75bef9f6c8
Tools • Dart 2.10.1
hover: Flutter engine commit: https://github.com/flutter/engine/commit/75bef9f6c8ac2ed4e1e04cdfcd88b177d9f1850d
hover: Finding out the C compiler version
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
hover: Sharing the content of go.mod
module flutter_systray_example/go

go 1.15

require (
        github.com/JanezStupar/flutter_systray/go v0.0.0-00010101000000-000000000000
        github.com/go-flutter-desktop/go-flutter v0.42.0
        github.com/pkg/errors v0.9.1
)

replace github.com/JanezStupar/flutter_systray/go => /Users/apple/workspace/go/src/github.com/JanezStupar/flutter_systray/go
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/import-flutter_systray-plugin.go go/cmd/main.go  go/cmd/options.go

@gedw99
Copy link
Author

gedw99 commented Nov 6, 2020

Hey. Yeah look like dmg for now.

I am wanting to load a flutter webview instead of a native view.
Will have a look around

@gedw99
Copy link
Author

gedw99 commented Nov 6, 2020

anyway the main issue is the icon not showing for release pkg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants