Error: Please specify platform for 'env1' environment

Hello, I’m brand new to Platform IO!

I want to load a test program for the Lilygo T5 V2. The code works in the Arduino IDE. Unfortunately, Platform IO doesn’t upload it:

Error: Please specify platform for ‘env1’ environment

platformio.ini

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = zinggjm/GxEPD@^3.1.3

What I have done wrong?

My code:

#include <Arduino.h>

// According to the board, cancel the corresponding macro definition
#define LILYGO_T5_V213                    //ist 250, 122 px (soll 212 x 104)

//#include <boards.h>
#include <GxEPD.h>
#include <SD.h>
#include <FS.h>

#include <GxDEPG0213BN/GxDEPG0213BN.h>    // 2.13" b/w  form DKE GROUP

// FreeFonts from Adafruit_GFX
#include <Fonts/FreeMonoBold9pt7b.h>
#include <Fonts/FreeMonoBold12pt7b.h>
#include <Fonts/FreeMonoBold18pt7b.h>
#include <Fonts/FreeMonoBold24pt7b.h>

#include <GxIO/GxIO_SPI/GxIO_SPI.h>
#include <GxIO/GxIO.h>

GxIO_Class io(SPI, /*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16); // arbitrary selection of 17, 16
GxEPD_Class display(io, /*RST=*/ 16, /*BUSY=*/ 4); // arbitrary selection of (16), 4

//GxIO_Class io(SPI,  EPD_CS, EPD_DC,  EPD_RSET);
//GxEPD_Class display(io, /*RST=*/ EPD_RSET, /*BUSY=*/ EPD_BUSY); // default selection of (9), 7


    uint16_t box_x = 126;
    uint16_t box_y = 62;
    uint16_t box_w = 23;
    uint16_t box_h = 28;
    uint16_t cursor_y = box_y + 24;




void drawHelloWorld();
void showPartialUpdate();



void setup()
{
    display.init();
    display.eraseDisplay();
    
    display.setTextColor(GxEPD_BLACK);
    display.setRotation(1);
    display.setFont(&FreeMonoBold9pt7b);

    drawHelloWorld();     // UP
    //display.drawPaged(drawHelloWorld); // version for AVR using paged drawing, works also on other processors

    
    display.setFont(&FreeMonoBold18pt7b);
    //display.drawRect(box_x, box_y, box_w, box_h, GxEPD_BLACK);    //w= von x nach lks / h= von y nach unten
    display.drawLine(125, 61, 0, 0, GxEPD_BLACK);
    display.drawLine(125, 61, 250, 0, GxEPD_BLACK);
    display.drawLine(125, 61, 0, 122, GxEPD_BLACK);
    display.drawRect(0, 0, 250, 122, GxEPD_BLACK);      // x y w h / w=von x nach re / h=von y nach unten
    display.drawRect(125, 61, 25, 30, GxEPD_BLACK);     // x y w h / w=von x nach re / h=von y nach unten
    display.update();
    delay(1000);
}






void drawHelloWorld()
{
    display.eraseDisplay();
    display.setCursor(20, 20);
    display.print("Hello World! 9pt");
    display.setFont(&FreeMonoBold12pt7b);
    display.setCursor(30, 40);
    display.print("Bold12pt");
    display.setFont(&FreeMonoBold18pt7b);
    display.setCursor(3, 75);
    display.print("18pt");
    display.update();
    display.setFont(&FreeMonoBold12pt7b);
    display.drawCircle(180, 61, 15, GxEPD_BLACK);       // x,y,r,color
    display.drawTriangle(100, 90, 90, 100, 110, 100, GxEPD_BLACK);    // x1,y1,x2,y2,x3,y3,color
    display.fillTriangle(150, 90, 140, 100, 160, 100, GxEPD_BLACK);   // x1,y1,x2,y2,x3,y3,color
    delay(1000);
    
}




void showPartialUpdate()
{
    // es verhindert unerwünschte Hintergrund-Anzeigen:
    display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, false);
    for (int i=0;i<10;i++)
    { 
      display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
      display.setCursor(box_x, cursor_y);
      display.print(i);
      display.updateWindow(box_x, box_y, box_w, box_h, true);
      //display.powerDown();
      delay(1000);
    }
}





void loop() {
  for (int a=1;a<10;a++)
  { 
    showPartialUpdate();   // UP
    delay(5000);
  }
  delay(5000);  
}

There is no env1 in the platformio.ini you showed though?

Make sure you’re selecting the right project and environemnt in the project environment switcher.

Yes, it works! Thanks!
Platform io is much faster when compiling with ESP! Great.