Compile Error: 'ENV_NAME' was not declared in this scope

I am using LILYGO T3_V1.6.1 (Bord selected: TTGO LoRa32-OLED) and get the following compilation error:
main.ino:2002:20: error: ‘ENV_NAME’ was not declared in this scope
SYSdata[“env”] = ENV_NAME;
Any solution to that?

Yes, you should try platformio with the default environments, all the appropriate macro are defined with it