Computer or iPhone glitch
Your iPhone 4 needs to generate a pairing record and trust the computer.

First go through each of the steps. Don't skip steps and do them in order.

https://support.apple.com/en-us/HT204095

If you don't see this message when you try to sync the phone over USB with iTunes, then you can remove all pairing records as follows:


Back up iPhone 4 (to the cloud or a computer)
Erase iPhone 4 (settings -> erase all content and settings)
Restore the backup to iPhone 4
Connect iPhone 4 to the computer over USB and be sure you Trust when prompted on the iPhone.


If the above doesn't work, then restore the phone and repeat the third and further steps above.