Error: ERROR All specified devices ['OTA'] could not be resolved

Hi there. I was modifying some ESP for changing the SSID of the wifi. On this one specific, i uploaded the code over serial from the raspberry running HA, and right now i can control lights from the dashboard and everything, even on Esphome builder i can see the logs, but for a reason when uploading over the air, it doesnt "detect" the ESP. it says "ERROR All specified devices ['OTA'] could not be resolved. Is the device connected to the network? If you know the IP, set 'use_address' in your network config."

This is my config file currently, thanks for any help.

esphome:
  name: esp2
  friendly_name: esp2

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "i erased this"


wifi:
  ssid: "Aruba"
  password: "12345678" 
  use_address: 192.168.50.197 

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp2 Fallback Hotspot"
    password: "12345678"
switch:
  - platform: gpio
    pin: 27
    id: test1
    name: "porteria"
    inverted: True
    on_turn_on:
    - delay: 0.5s
    - switch.turn_off: test1
  - platform: gpio
    pin: 26
    id: test2
    name: "relay4"
    inverted: True
  - platform: gpio
    pin: 5
    id: relayt1
    name: "relayt"
    inverted: True
  - platform: gpio
    pin: 18
    id: relayt2
    name: "relayt2"
    inverted: True
binary_sensor:
  - platform: gpio
    pin:
      number: 15
      mode: INPUT_PULLUP
    internal: true
    id: main_button
    on_state: 
      then:
        - switch.toggle: relayt1
  - platform: gpio
    pin:
      number: 4
      mode: INPUT_PULLUP
    internal: true
    id: main_button2
    on_state: 
      then:
        - switch.toggle: relayt2

captive_portal:
    

That line says use this IP address to contact the device. Is that the IP address the device now has?

Since use_addess is mainly designed to be able to flash a device currently owning the defined use_address IP while the defined static_ip is the one it gets after having rebooted.
use_address doesn't define a static address for the device itself, means if there's a dhcp server in the network and no manual_ip got defined on the ESP it could get any IP from the DHCP server in the future.
Another OTA might result in flashing to any other device which got the IP defined in use_address.

better use

wifi:
  [ ...] # all the other essentials
  manual_ip:
    static_ip: 192.168.50.197
    gateway: thegatewayip
    dns1: thednsip
    subnet: thesubnet