Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Desktop: Error setting the App Icon #2344

Closed
Anonyfox opened this issue Apr 19, 2024 · 3 comments
Closed

Desktop: Error setting the App Icon #2344

Anonyfox opened this issue Apr 19, 2024 · 3 comments
Assignees
Labels
bug Something isn't working cli Related to the dioxus-cli program needs reproduction An issue that is missing a reproduction
Milestone

Comments

@Anonyfox
Copy link

Problem

I want to set the app icon on my desktop app (Mac OS). I didn't find something related to that in the docs or the existing issues so far, but stumbled upon the setting in the Dioxus.tml that can be set:

[bundle]
icon = ["icon.icns"]

I tried it with a .png or the .icns file (created properly from that png) and various ways of setting the path. What happens is either a "file not found" bug or

Failed to bundle project: IoError(
    Os {
        code: 63,
        kind: InvalidFilename,
        message: "File name too long",
    },
)

Steps To Reproduce

Steps to reproduce the behavior:

  • new dioxus app (desktop) from created with dx new
  • put a icon image somewhere in the folder (iE crate root)
  • add the TOML setting as above
  • try dx bundle --release

Expected behavior

A clear and concise description of what you expected to happen.

The app should have the correct icon

Environment:

  • Dioxus version: v0.5 (latest from crates io)
  • Rust version: rustc 1.77.2 (25ef9e3d8 2024-04-09)
  • OS info: MacOS Sonoma 14.4
  • App platform: desktop
@jkelleyrtp jkelleyrtp added this to the 0.6.0 milestone Jul 25, 2024
@jkelleyrtp jkelleyrtp added cli Related to the dioxus-cli program bug Something isn't working labels Jul 31, 2024
@jkelleyrtp jkelleyrtp self-assigned this Aug 1, 2024
@jkelleyrtp jkelleyrtp added the needs reproduction An issue that is missing a reproduction label Aug 2, 2024
@Andrew15-5
Copy link
Contributor

Can you try the same thing, but with the latest git version? It works with bd58a92, but not with v0.5.2 on Linux.

╰─ dx-0.5.2 bundle -r
build desktop done
Adding assets from dist to bundle
thread 'main' panicked at packages/cli/src/cli/bundle.rs:193:13:
Failed to bundle project: BundlerError(
    Error {
        context: "Failed to build data folders and files",
        source: BundlerError(
            Error {
                context: "Failed to copy resource files",
                source: IoError(
                    Os {
                        code: 36,
                        kind: InvalidFilename,
                        message: "File name too long",
                    },
                ),
            },
        ),
    },
)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@NTL00068
Copy link

NTL00068 commented Oct 2, 2024

On MacOS, I have observed that deleting target and dist folders, then re-running dx bundle, solves the problem.

@jkelleyrtp
Copy link
Member

Should be fixed now that we've upgraded our tauri bundle support

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working cli Related to the dioxus-cli program needs reproduction An issue that is missing a reproduction
Projects
None yet
Development

No branches or pull requests

4 participants