Settings that have been screwed up as a result of a bad update can cause your device to perform strangely, and the warning you're seeing could be one of the signs. In this situation, consider resetting all of your iPhone's settings to their default or original state. Here's how you do it:
- Go to the General tab in the Settings menu.
- A reset can be found by scrolling down and tapping it.
- If prompted, enter your device's passcode.
- Choose Reset all settings from the drop-down menu.
Allow your iPhone to reboot after the system settings reset and then configure necessary options accordingly. Try plugging the Lightning cable into the charging/Lightning port and see if the warning is gone.