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

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

Closed
smbcloudXYZ opened this issue Aug 17, 2024 · 14 comments
Closed

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

smbcloudXYZ opened this issue Aug 17, 2024 · 14 comments

Comments

@smbcloudXYZ
Copy link

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
Copy link
Member

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.

@smbcloudXYZ
Copy link
Author

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

@smbcloudXYZ
Copy link
Author

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

@FabianLars
Copy link
Member

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.

@smbcloudXYZ
Copy link
Author

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

@FabianLars
Copy link
Member

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

@smbcloudXYZ
Copy link
Author

smbcloudXYZ commented Sep 8, 2024

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

@FabianLars
Copy link
Member

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.

@smbcloudXYZ
Copy link
Author

I'll try that. Thanks for being responsive.

@smbcloudXYZ
Copy link
Author

I updated our app to use Tauri v2, now all platfroms are failing with the same PNG invalid signature errors. Do we need to set environment variables to production for cargo and/or npm, somehow?

@smbcloudXYZ
Copy link
Author

I use the default icons generated by the create-tauri-app and they're still failing.

@smbcloudXYZ
Copy link
Author

Apple M1 Pro, macOS Sonoma 14.7

@smbcloudXYZ
Copy link
Author

Windows build is succeed.

@smbcloudXYZ
Copy link
Author

Ok, we found the problem: git lfs. I forgot to setup the checkout action to pull the files.

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