Cannot use SPI or set custom pins for SPI on esp32

You are using V1.0.5 of the ESP32 core and 2.0.0 is available. Maybe an update would help. Go to Tools->Board:->Boards Manager... and select Type "Updatable".

If you don't want to update, open the file C:\Users\newto\OneDrive\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.5\cores\esp32\esp32-hal-gpio.c and see what pinMode() is doing on Line 115.

If that doesn't sort it out, open the file C:\Users\newto\OneDrive\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.5\cores\esp32\esp32-hal-spi.c and see which pin it is calling pinMode() for on line 87. That seems to be causing the crash. Maybe the pin you have chosen is invalid in some way.