Help!! Speaker not working

my iphone keeps giving me the message "this accessory is not made to to work with iphone, would you like to turn on airplane mode?" as a result my speaker is not working
but when i play the speaker while on a call it works normally playing ipod music

this has been coming ever since i tried plugging a charger to the iphone which never worked.

i did some searching on the itunes folder and found that there is a log file which says the following
2009-07-07 15:59:51.938|AppleMobileDeviceHelper.exe|2208:2469 2536|/SourceCache/DeviceLinkX/DeviceLinkX-136.2/Utility/DeviceLinkListener.c:_copyMobileDeviceValue| ERROR: Could not connect to attached device: (null) (107)

i reckon this is the file or log file causing this problem to persist even though there is no accessory attached, also once or twice it said there was an incompatible dock attached to my iphone, though there is nothing attached

can someone pls tell me how to get rid of the message
also pls tell me where i can find this file on the phone either by using iphone browser or on the phone itself

Older speakers, etc will play the music just fine. The trouble you run into is the charging of the iPhone. That is what is not reported. Also, the Airplane mode, while turning off the cell radios disabling calls and texts, does indeed reduce the interference.