Help with ESP32

Hello,

I am working on a project with ESP32 which must use bluetooth first and wifi later, when testing with bluetooth everything is great, but when including the wifi library it seems that the size is too much

The board I use is ESP32 Dev KitC V2

When trying to upload the program I get the following error:
Sketch uses 1655265 bytes (126%) of the program storage space. The maximum is 1310720 bytes.

Should I buy a board with more memory? In that case, which one?

Thank you

Adjust the size of the flash memory in the board menu.

In Arduino IDE the memory is set at 4M, which coincides with what the manufacturer states, may I set a larger memory?

I'm not with my laptop right now, I'm answering from my phone, so I can't tell you exactly, but look at the option where you can configure the flash size, FS and OTA.
Use the option that leaves you with the most flash available.

Try the ESP32 NimBLE Bluetooth stack which is about 1/2 the size of the default. The only disadvantage is NimBLE does not support Bluetooth Classic.

Or choose a different Flash Partition Scheme. For example, "Huge APP" allocates 3MB of Flash for app code.

These are the options that I have available in the arduino IDE

under Tools>Partition scheme set to Huge App

Thank you,
With this the memory error has been solved

But now it shows me this error, normally I solve it by pressing the reset button when the program is Connecting...... apears, but now it doesn't work

okay, now it worked for me by pressing the other button, the boot button

Thanks to each and every one of you

Gracias a todos y cada uno de vosotros