Dell inspiron 3521 laptop Battery detecting but Not Charging . how to solve this problem..

Look at the age of the battery. Anything past 2 years and you replace that. If that doesn't clear it up then replace the charger. I take it you have already googled this and tried software methods. Cost is about 30 bucks here from Amazon for both items.

PS. While I know to look out for old batteries some want to test batteries with the Dell app or BatteryBar.

Typically there is a Dell app which will tell you the battery health. You should find it on your taskbar. Right click and select Dell Power Manager. Some batteries also have a button which will indicate battery health when pressed via 1-5 LEDs.

Dell power cables also have a sense wire which is prone to breaking with repeated flexing. When it breaks your computer can no longer tell what type of battery it is talking to.

Finally, if the problem is with a motherboard component (connector or otherwise) a new battery may not help. This was the case with my Inspiron 1720. I replaced the battery and it still wouldn't charge. Fortunately it still works just fine on AC power.