This is a solved problem, and IFF was invented in the 1930s: https://en.wikipedia.org/wiki/Identification_friend_or_foe

It is believed that the Kuwaiti aircraft did not have its IFF transponder turned on (IFF is and has always been standard equipment on the F-18).

Clearly the problem isn't solved if people are still getting friendly fired.