Esp32 ota crashes

hi, iam trying to run ota example of espressif esp idf in platformio . and the code crashes in between and i get the following error .
␛[0;32mI (185) ota: Starting OTA example…␛[0m
␛[0;31mE (185) esp_ota_ops: not found ota data␛[0m
Guru Meditation Error: Core 1 panic’ed (LoadProhibited)
. Exception was unhandled.
Register dump:
PC : 0x400d140e PS : 0x00060430 A0 : 0x00000000 A1 : 0x3ffd9690
A2 : 0x3f400f70 A3 : 0x3ffce2b8 A4 : 0x00000000 A5 : 0x00010000
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x800d1407 A9 : 0x3ffd9670
A10 : 0x000000b9 A11 : 0x3ffc3bf0 A12 : 0x3f400fdd A13 : 0x3ffc3c18
A14 : 0x00000005 A15 : 0x3ffc3bf4 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000008 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffc

Backtrace: 0x400d140e:0x3ffd9690 0x7ffffffd:0x3ffd96f0

Rebooting…

please help me!!!
Thanks in advance.

Hello I had the same problem, I solved it by using custom partitions.csv file and refer to it on the ini file. The custom partition file is the same as partitions_two_ota.csv but just put on the root directory of the Platformio project. I have renamed the file to partitions_custom.csv and referred to it in the ini file like that.

board_build.partitions = partitions_custom.csv

The content of the file is the same as the original partitions_two_ota.csv as below.

# Name,   Type, SubType, Offset,   Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs,      data, nvs,     ,        0x4000,
otadata,  data, ota,     ,        0x2000,
phy_init, data, phy,     ,        0x1000,
factory,  app,  factory, ,        1M,
ota_0,    app,  ota_0,   ,        1M,
ota_1,    app,  ota_1,   ,        1M,

Not sure if this is the best approach but this solved my problem.