Chosen Solution
Ok, so a little more detail into this. My Nexus 7 2012 is still going strong. It’s been locked away and unused for awhile due to being on Android 5.1.1 but I finally decided to resurrect it. I plug it into the PC, and every 2-4 seconds it connects and disconnects from the PC with a “Last usb device plugged in not recognized” error. I have tried 3 different usb cables Tried playing with MTP options Tried different usb ports Tried a cache wipe Replaced the nexus charge port Even in recovery/ADB mode it does the same thing. However it charges just fine. Any ideas? It’s been a pain for 2 weeks now.
Try to open the tablet and push the wire that connects to the charging port. Do it gently but enough to make it click into place. This may help. Also try venting the charger back wards when charging the tablet