clash-for-flutter icon indicating copy to clipboard operation
clash-for-flutter copied to clipboard

mac平台hover run --debug报错,build也是报同样的错

Open zhuima opened this issue 3 years ago • 4 comments

❯ flutter doctor -v [✓] Flutter (Channel master, 2.5.0-6.0.pre.29, on Mac OS X 10.15.7 19H524 darwin-x64, locale zh-Hans-CN) • Flutter version 2.5.0-6.0.pre.29 at /usr/local/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 6876c52b5b (28 hours ago), 2021-08-08 15:34:09 -0700 • Engine revision c0e59bc7b6 • Dart version 2.14.0 (build 2.14.0-383.0.dev)

❯ go version go version go1.16.3 darwin/amd64

构建报错信息

❯ hover run --debug hover: Downloading engine for platform darwin-debug_unopt at version c0e59bc7b65e2330b2be9d9f2a8a1515b968a55c... Download completed in 22.79s Download completed in 45.79s 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 clash-for-flutter... 2,559ms

💪 Building with sound null safety 💪

hover: Compiling 'go-flutter' and plugins hover: Successfully compiled executable binary for darwin hover: Build finished, starting app... hover: Running clash_for_flutter in debug_unopt mode go-flutter: WARNING error creating the resource window: VersionUnavailable: NSGL: Failed to create OpenGL context [ERROR:flutter/shell/platform/embedder/embedder_surface_gl.cc(102)] 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(102)] 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":94.14671814671813,"monitorWidthMm":518,"monitorWidthSc":1920,"mscpi":94.14671814671813,"pixelRatio":0.5884169884169883,"ppsc":1,"windowWidthPx":900,"windowWidthSc":900} 2021-08-10 10:33:26.223 clash_for_flutter[47982:798974] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1677.201/Foundation/Misc.subproj/NSUndoManager.m:363 2021-08-10 10:33:26.224 clash_for_flutter[47982:798974] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.' *** First throw call stack: ( 0 CoreFoundation 0x00007fff30081b57 __exceptionPreprocess + 250 1 libobjc.A.dylib 0x00007fff68efb5bf objc_exception_throw + 48 2 CoreFoundation 0x00007fff300aad08 +[NSException raise:format:arguments:] + 88 3 Foundation 0x00007fff3279cead -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191 4 Foundation 0x00007fff326d95fe +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 440 5 AppKit 0x00007fff2d26665c -[NSApplication run] + 864 6 clash_for_flutter 0x00000000045f9d71 nativeLoop + 81 7 clash_for_flutter 0x00000000045f89e2 _cgo_dab539588ee3_Cfunc_nativeLoop + 34 8 clash_for_flutter 0x0000000004071550 runtime.asmcgocall + 112 ) libc++abi.dylib: terminating with uncaught exception of type NSException SIGABRT: abort PC=0x7fff6a1eb33a m=4 sigcode=0

goroutine 0 [idle]: runtime: unknown pc 0x7fff6a1eb33a stack: frame={sp:0x7000073dc548, fp:0x0} stack=[0x70000735e340,0x7000073ddf40) 00007000073dc448: 0000000000000080 0000000000000080 runtime: unknown pc 0x7fff6a1eb33a stack: frame={sp:0x7000073dc548, fp:0x0} stack=[0x70000735e340,0x7000073ddf40) 00007000073dc448: 0000000000000080 0000000000000080

goroutine 35 [syscall]: runtime.cgocall(0x45f89c0, 0xc0001367b0, 0x0) /usr/local/Cellar/go/1.16.3/libexec/src/runtime/cgocall.go:154 +0x5b fp=0xc000136780 sp=0xc000136748 pc=0x4008e1b github.com/getlantern/systray._Cfunc_nativeLoop(0x0) _cgo_gotypes.go:119 +0x45 fp=0xc0001367b0 sp=0xc000136780 pc=0x45c8fc5 github.com/getlantern/systray.nativeLoop(...) /Users/zhuima/go/pkg/mod/github.com/getlantern/[email protected]/systray_nonwindows.go:23 github.com/getlantern/systray.Run(0x0, 0x0) /Users/zhuima/go/pkg/mod/github.com/getlantern/[email protected]/systray.go:78 +0x3a fp=0xc0001367d0 sp=0xc0001367b0 pc=0x45c7f5a runtime.goexit() /usr/local/Cellar/go/1.16.3/libexec/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc0001367d8 sp=0xc0001367d0 pc=0x40718c1 created by github.com/mapleafgo/go-flutter-systray/go.(*GoFlutterSystrayPlugin).InitPlugin /Users/zhuima/go/pkg/mod/github.com/mapleafgo/go-flutter-systray/[email protected]/plugin.go:61 +0x6a

zhuima avatar Aug 10 '21 02:08 zhuima

请贴下hover doctor的输出

mapleafgo avatar Aug 10 '21 02:08 mapleafgo

❯ hover doctor hover: Hover version v0.46.5 running on darwin hover: Sharing packaging tools hover: darwin-bundle is supported hover: darwin-dmg is supported hover: darwin-pkg is supported hover: Packaging linux-appimage is not supported on darwin hover: To still package linux-appimage on darwin you need to run hover with the --docker flag. hover: Packaging linux-deb is not supported on darwin hover: To still package linux-deb on darwin you need to run hover with the --docker flag. hover: Packaging linux-pkg is not supported on darwin hover: To still package linux-pkg on darwin you need to run hover with the --docker flag. hover: Packaging linux-rpm is not supported on darwin hover: To still package linux-rpm on darwin you need to run hover with the --docker flag. hover: Packaging linux-snap is not supported on darwin hover: To still package linux-snap on darwin you need to run hover with the --docker flag. hover: Packaging windows-msi is not supported on darwin hover: To still package windows-msi on darwin you need to run hover with the --docker flag. hover: hover: Sharing flutter version

Flutter 2.5.0-6.0.pre.29 • channel master • https://github.com/flutter/flutter.git Framework • revision 6876c52b5b (29 hours ago) • 2021-08-08 15:34:09 -0700 Engine • revision c0e59bc7b6 Tools • Dart 2.14.0 (build 2.14.0-383.0.dev)

hover: Flutter engine commit: https://github.com/flutter/engine/commit/c0e59bc7b65e2330b2be9d9f2a8a1515b968a55c 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: Finding out the C compiler version Apple clang version 12.0.0 (clang-1200.0.32.29) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin hover: Sharing the content of go.mod module github.com/mapleafgo/clash-for-flutter/go

go 1.16

require ( github.com/go-flutter-desktop/go-flutter v0.43.0 github.com/go-flutter-desktop/plugins/path_provider v0.4.0 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb github.com/mapleafgo/go-flutter-clash/go v0.0.0-20210622080346-be32a554e800 github.com/mapleafgo/go-flutter-systray/go v0.0.0-20210413014355-59e3141b1836 github.com/miguelpruivo/flutter_file_picker/go v0.0.0-20210728213511-fc8fd7ceeee9 github.com/pkg/errors v0.9.1 github.com/wzshiming/sysproxy v0.2.1 )

// replace github.com/mapleafgo/go-flutter-clash/go => ../../go-flutter-clash/go // replace github.com/wzshiming/sysproxy => ../../sysproxy/ hover: Sharing the content of hover.yaml application-name: Clash_For_Flutter executable-name: "" package-name: "" organization-name: mapleafgo license: MIT target: lib/main_desktop.dart branch: "" cache-path: "" opengl: "" engine-version: "" hover: Sharing the content of go/cmd go/cmd/import-file_picker-plugin.go go/cmd/import-go-flutter-clash-plugin.go go/cmd/import-go-flutter-systray-plugin.go go/cmd/import-path_provider-plugin.go go/cmd/main.go go/cmd/options.go go/cmd/pac-proxy.go

zhuima avatar Aug 10 '21 03:08 zhuima

systray依赖的问题,这个插件在mac上表现一直有问题。我替换下其它插件吧

mapleafgo avatar Aug 10 '21 03:08 mapleafgo

确实,我去翻了下issue,有人在16年提过跟我贴的报错类似的情况 https://github.com/getlantern/systray/issues/20,似乎在osx上也是无解

zhuima avatar Aug 10 '21 03:08 zhuima