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

为什么build后的可执行文件双击打开时无响应或闪退 #4035

Open
trouvaille2023 opened this issue Jan 25, 2025 · 1 comment
Open
Labels
Application Support Requested awaiting feedback More information is required from the requestor

Comments

@trouvaille2023
Copy link

Description

我用wails写了一个简单的测试软件,当我运行wails dev时可以正常运行,但是当我wails build后,无论是在Windows环境下还是macOS环境下,打开生成的可执行文件时均是闪退,任务栏一闪而过。

示例代码:
https://github.com/trouvaille2023/dstoolbox

To Reproduce

git clone https://github.com/trouvaille2023/dstoolbox

wails build

Expected behaviour

如何解决这个问题,以便能正常运行

Screenshots

No response

Attempted Fixes

No response

System Details

# Wails
Version | v2.9.2

# System
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | MacOS                                                                                                                                                                                                                             |
| Version      | 15.2                                                                                                                                                                                                                              |
| ID           | 24C101                                                                                                                                                                                                                            |
| Go Version   | go1.23.5                                                                                                                                                                                                                          |
| Platform     | darwin                                                                                                                                                                                                                            |
| Architecture | amd64                                                                                                                                                                                                                             |
| CPU          | Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz                                                                                                                                                                                          |
| GPU          | Chipset Model: Intel UHD Graphics 630 Type: GPU Bus: Built-In VRAM (Dynamic, Max): 1536 MB Vendor: Intel Device ID: 0x3e9b Revision ID: 0x0002 Automatic Graphics Switching: Supported gMux Version: 5.0.0 Metal Support: Metal 3 |
| Memory       | 16GB                                                                                                                                                                                                                              |
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────────────────────┐
| Dependency                | Package Name | Status    | Version         |
| Xcode command line tools  | N/A          | Installed | 2409            |
| Nodejs                    | N/A          | Installed | 20.5.0          |
| npm                       | N/A          | Installed | 9.8.0           |
| *Xcode                    | N/A          | Installed | 16.0 (16A5230g) |
| *upx                      | N/A          | Available |                 |
| *nsis                     | N/A          | Installed | v3.10           |
└─────────────────────── * - Optional Dependency ────────────────────────┘

# Diagnosis
Optional package(s) installation details: 
  - upx : Available at https://upx.github.io/

 SUCCESS  Your system is ready for Wails development!

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context

No response

@trouvaille2023 trouvaille2023 added the Bug Something isn't working label Jan 25, 2025
@leaanthony leaanthony added Application Support Requested and removed Bug Something isn't working labels Jan 25, 2025
@leaanthony
Copy link
Member

感谢使用Wails!开发环境和构建环境的差异问题确实难以诊断,但通常这与环境配置或构建过程有关,而不是框架本身的bug。让我们一起找出问题的根源。

为了帮助我们有效地调查这个问题,请提供以下信息:

提供最小复现示例

创建一个能演示问题的最小项目:

  1. 从一个全新的Wails项目开始
  2. 添加能复现问题的最少代码
  3. 详细记录复现问题的具体步骤
  4. 在此issue中使用代码块分享代码

构建过程信息

  1. 启用调试信息的完整构建输出(wails build -v 2
  2. 开发过程中浏览器控制台的任何错误信息
  3. 运行构建版本时应用程序日志中的任何错误信息

应用配置

  1. 您的wails.json配置
  2. 您的package.json(如果使用npm/yarn)
  3. 应用程序依赖的任何环境变量
  4. 在开发和构建环境中表现不同的相关代码段

调查步骤

在重新提交之前,请提供以下步骤的详细信息:

  1. 清理项目:

    • 运行go clean -cache -modcache
    • 删除所有node_modules目录
    • 从头重新构建
  2. 比较环境:

    • 在开发和构建环境中添加环境变量的调试日志
    • 检查硬编码路径或开发环境特定的配置
    • 验证构建输出目录的文件权限
  3. 测试边缘情况:

    • 问题是否在最小复现示例中出现?
    • 是否有特定的用户操作会触发问题?
    • 问题是否在不同机器上都存在?

提供的信息越详细,我们就能提供越好的帮助。这些信息将帮助确定问题是环境特定的、配置相关的,还是可能的框架bug。

感谢您的耐心配合,帮助我们让Wails变得更好!

@leaanthony leaanthony added the awaiting feedback More information is required from the requestor label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Application Support Requested awaiting feedback More information is required from the requestor
Projects
None yet
Development

No branches or pull requests

2 participants