tauri-apps / tauri-action

Build your Web application as a Tauri binary for macOS, Linux and Windows
https://tauri.app
MIT License
876 stars 144 forks source link

Failed to compile on Ubuntu: `Invalid PNG signature.` #889

Open smbpndk opened 4 weeks ago

smbpndk commented 4 weeks ago

Ubuntu compilation failed with this error:

error: proc macro panicked
  --> src/main.rs:95:14
   |
95 |         .run(tauri::generate_context!())
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: message: failed to read icon /home/runner/work/project/src-tauri/icons/App-152x152.png: Invalid PNG signature.

error: could not compile `app` (bin "app") due to 1 previous error
       Error failed to build app: failed to build app
Error: Command failed with exit code 1: npm run release build

A simple error give result about ffmpeg but we don't use it and we couldn't find similar problem tauri related. Any pointers?

FabianLars commented 4 weeks ago

Hmm, how did you generate the icon? Can you regenerate it? Or maybe try some other tool to create/convert it? This error (according to google etc) should only happen when the file is actually corrupt.

smbpndk commented 2 weeks ago

Still the same error. I'll try to just include the main icons and see how it goes.

smbpndk commented 2 weeks ago

And it's still the same error. I've no idea what's happening. I'll try to change the icons.

FabianLars commented 2 weeks ago

Can you share one of the broken icons? Or at least tell us how you generated them? Also it may be interesting to see if the tauri icon command can handle those icons as an input or if it fails with the same error.

smbpndk commented 1 week ago

This is from the very tauri icon command. And I tried to use an online PNG converter with the same file. Still no luck. I haven't tried to create a completely new icon from a new file. Maybe that'd work. Windows and macOS have no issue.

app-icon.png ![app-icon](https://github.com/user-attachments/assets/ef0f4b85-9fac-4eff-96e1-c26f856bf0be)
FabianLars commented 1 week ago

If you ran tauri icon and it still shows an error about that exact same icon then maybe try deleting the icons folder first (maybe back it up somewhere) since that size does should not come from tauri icon.

At first glance the icon you posted seems to be fine so it hopefully is really just the App-152x152.png file. Arguably a bit weird that it tries to use it in the first place tho

smbpndk commented 1 week ago

Ok, i have completely replace the icon with a new one, and it sill the same error. This is really frustrating. I used tauri icon command as before.

error: proc macro panicked
   --> src/main.rs:104:14
    |
104 |         .run(tauri::generate_context!())
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: message: failed to read icon /home/runner/work/splitfire/splitfire/frontend/splitfire-desktop/src-tauri/icons/icon.png: Invalid PNG signature.

error: could not compile `app` (bin "app") due to 1 previous error
       Error failed to build app: failed to build app
Error: Command failed with exit code 1: npm run release build
app-icon.png ![app-icon](https://github.com/user-attachments/assets/2525e868-3dc7-4b81-a658-17f581d81b55)
FabianLars commented 1 week ago

I don't know what the cause could be then tbh. Does it fail with the default icons too? (create a new app with create-tauri-app and copy over the icons)

Is your repo public?

I didn't have the time to try your icons posted here myself yet but i'll try to take some time for it tomorrow.