Cant Make acces point when upload to ESP32

Im trying to make an access point in esp32 based on this template. when i upload it with arduino ide the access point is visible by my laptop and phone. but when i upload by using platformio my devices cannot detect the access point. i also have try to connect it independently by typing the ssid and password but it doesnt work. is there any of you having the same problem? if it yes how you fix this problem. thankyou

`#include <Arduino.h>
#include <WiFi.h>

#define led 2 
WiFiServer server(80);
WiFiClient client;


const char* ap_ssid =  "CNGO_AP";
const char* ap_password =  "Scafol123";

String http;
bool ledState =  false;
String boxMode = "None";

String header;
// put function declarations here:
int myFunction(int, int);
void sendResponse();
void updateLed();
void updateWebpage();

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(led, OUTPUT);
  Serial.print("Connecting to");
  Serial.println(ap_ssid);



    // Create the ESP32 access point  
  /*  
   * Alternative:  
   * softAP(const char* ssid,  
   *     const char* password,  
   *     int channel,  
   *     int ssid_hidden,   
   *     int max_connection  
   *       
   *     where:  
   *      ssid - this is the SSID that will be broadcast by ESP32  
   *          maximum of 63 characters  
   *      password - this is the password to connect to ESP32  
   *          minimum of 8 characters to function  
   *          Put NULL to make it open to public  
   *      channel - wifi channels (ranging from 1 to 13)  
   *      ssid_hidden - sets the SSID as broadcast or hidden  
   *          0: broadcast SSID  
   *          1: hidden SSID,   
   *           you need to type the exact SSID name in order to connect  
   *      max_connection - maximum number of connected clients  
   *          accepts 1 to 4 only  
   *            
   */  
  WiFi.softAP(ap_ssid, ap_password);  
  Serial.print("Access Point is running...");
  Serial.print("IP Address : ");
  Serial.println(WiFi.softAPIP());
  server.begin(); 
}

void loop() {
  // put your main code here, to run repeatedly:
  if ( client =  server.available()){
    Serial.print("New Client Detected!");
    String clientData = "";
    while (client.connected()){
      if(client.available()){
        char c =  client.read();
        http += c;
        Serial.write(c);
        if (c == 'n'){
          if (clientData.length() == 0){
            sendResponse();
            updateLed();
            updateWebpage();
            break;
          }else{
            clientData = "";
          }
        } else if (c == 'r'){
          clientData += c;
        }
      }
    }
    http = "";
    client.stop();
    Serial.println("Client disconnected");
    Serial.println("");
  }
}

void sendResponse(){
  client.println("HTTP/1.1 200 OK");  
  client.println("Content-type:text/html");  
  client.println("Connection: close");  
  client.println();   
}

void updateWebpage(){
  client.println("<!DOCTYPE html><html>");  
  client.println("<head>");  
  client.println("<title>CNGO Box Station</title>");  
  client.println("</head>");  
  client.println("<body><h1>Simple ESP32 Web Server</h1>");  

  // led control
  if (ledState == false) {  
  client.println("<h3>1. LED is OFF</h3>");    
  client.println("<p><a href=\"/led/on\"><button>Turn ON</button></a></p>");  
  } else {
    client.println("<h3>LED is OFF</h3>");   
    client.println("<p><a href=\"/led/off\"><button>Turn OFF</button></a></p>");  
  }   
  
  client.print("<hr>");  
}

void updateLed(){
    // In here we will check the HTTP request of the connected client  
  //  using the HTTP GET function,  
  //  Then turns the LED on / off according to the HTTP request  
  if    (http.indexOf("GET /led/on") >= 0) {  
  Serial.println("Request LED on");  
  ledState = true;  
  digitalWrite(led, HIGH);  
  } else if (http.indexOf("GET /led/off") >= 0) {  
  Serial.println("Request LED off");  
  ledState = false;  
  digitalWrite(led, LOW);  
  }
}`

Add

; Verbose
build_flags = -DCORE_DEBUG_LEVEL=5

to your platformio.ini. What are the logs in the serial monitor?


Thank you for your suggestion
heres the output and now it works! can you explain to me whats happening bassed on that setting