You probably need an AC mains lowpass filter on your power supply or get another power supply for the pump. The pump or the relay or the power supply is creating an electronic spike creating interference. You can buy or make a low pass filter that might correct the problem. Alternatively power from a battery.
See also issues with inexpensive plug in wall power supplies and ways to suppress relay arc (electronic interference) caused by relays.
This issue appears to be an electronic interference issue related to your inexpensive power supply, arcing of your relay which possibly momentarily disrupe your Arduino (which is also plugged in); not an issue with App Inventor.