Custom Partition not working

My esp-idf based project that has homekit & rainmaker returns below error while uploading.

Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [= ] 13.4% (used 44048 bytes from 327680 bytes)
Error: The program size (1105770 bytes) is greater than maximum allowed (1048576 bytes)
Flash: [=====*** [checkprogsize] Explicit exit, status 1=====] 105.5% (used 1105770 bytes from 1048576 bytes)

I investigated some topics :

and I created new partition file which is name custompart.csv and I copied to root

#Name, Type, SubType, Offset, Size, Flags
#Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
#Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x372000,
eeprom, data, 0x99, 0x382000, 0x1000,
spiffs, data, spiffs, 0x383000, 0x7D000,

I added these line to platformio.ini

board_build.partitions = $PROJECT_DIR/custompart.csv

But when I try to upload It returns still same error and same partition size.

What is the reason of this ? Why my partition file is not effective ?

So have you also configured this partition name file in ESP-IDF with the menuconfig tool? Docs.

Yes I did. I chosed custom part. and wrote custompart.csv to set as a name at proper textbox