I have changed the Dock icon for an app and it shows the new icon only when the app is not open. But as soon as I open it, the old icon comes back. When I close the app, the new icon appears again. I have tried pinning an alias to the Dock, but the same thing happens. It shows correctly in other places, such as Finder and Launchpad.
I have tried the following ways of changing the icon:
Copied the new image onto the info window.
Replaced the favicon.icns file in the package contents
Restarted the Dock and Finder several times
Cleared the icon cache by executing:
rm /var/folders/*/*/*/com.apple.dock.iconcache;killall Dock
I know the cache has updated because the icon for Pages, which I had uninstalled but hadn't unpinned from the Dock, changed to a question mark.
The app is YouTube to MP3 by MediaHuman.
How do I stop the icon from reverting? I am running macOS Sierra 10.12.6.