Do your wifi have internet access? Or maybe you S4 mini wifi setting is using the wrong IP address/DNS. Try to open up ur browser and check if it can actually surf internet. Your S4 mini must be able to connect to the internet in order to start the download. Maybe you have use certain app to limit the wifi interface or some sort of firewall. It is yours to check.
I have done this in more than 10 devices, the replace trick always works. (except for the S5 above)
Anyway thanks for your reply, for me it's not that of a big deal if i can't use the app (offline).