Error libreria firebase con vscode (Solucionado)

Haber si me puedo explicar, estoy usando como IDE el vscode, además tengo una manía, cuando empiezo un proyecto, pruebo que estén instaladas las librerías librerías, para este proyecto con el esp32 preciso, json.h v 5.13, firebaseEsp32.h, WiFi.h, y la de arduino que la coloca por default vscode. cuando coloco la firebaseEsp32, comienza el error, lo raro que si la prueba la realizo sobre plataforma de un UNO o Mega, funciona, pero si compilo para el esp32 da error, pero con el IDE de arduino funciona perfecto, probe sacarla de la carpeta que creo para el proyecto y llevarla a la carpeta global de librerias de vscode y nada.

codigo de prueba

#include <Arduino.h>
#include <WiFi.h>
#include <FirebaseESP32.h> //esta da problemas con el ESP32

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

error

> Executing task in folder Firebase_01: C:\Users\NOAR\.platformio\penv\Scripts\platformio.exe run <

Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (4.2.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20002.0 (2.0.2)
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 50 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
Generating partitions .pio\build\esp32doit-devkit-v1\partitions.bin
Archiving .pio\build\esp32doit-devkit-v1\libFrameworkArduinoVariant.a
Indexing .pio\build\esp32doit-devkit-v1\libFrameworkArduinoVariant.a
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\FirmwareMSC.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\HWCDC.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\IPv6Address.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\MD5Builder.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\Print.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\USB.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\USBCDC.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\USBMSC.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\WString.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\base64.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-cpu.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-i2c-slave.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-matrix.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-misc.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-psram.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-rmt.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-sigmadelta.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-spi.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-time.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-timer.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-tinyusb.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-touch.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-uart.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\firmware_msc_fat.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\libb64\cdecode.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\libb64\cencode.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\main.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\stdlib_noniso.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\wiring_pulse.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\esp32doit-devkit-v1\libFrameworkArduino.a
Indexing .pio\build\esp32doit-devkit-v1\libFrameworkArduino.a
Linking .pio\build\esp32doit-devkit-v1\firmware.elf
Retrieving maximum program size .pio\build\esp32doit-devkit-v1\firmware.elf
Checking size .pio\build\esp32doit-devkit-v1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.9% (used 16148 bytes from 327680 bytes)
Flash: [==        ]  15.7% (used 206209 bytes from 1310720 bytes)
Building .pio\build\esp32doit-devkit-v1\firmware.bin
esptool.py v3.3
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
==================================== [SUCCESS] Took 23.45 seconds ====================================
Las tareas reutilizarán el terminal, presione cualquier tecla para cerrarlo.

> Executing task in folder Firebase_01: C:\Users\NOAR\.platformio\penv\Scripts\platformio.exe run <

Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (4.2.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20002.0 (2.0.2)
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 50 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Firebase ESP32 Client @ 4.0.0
|   |-- Ethernet @ 2.0.0
|   |   |-- WiFi @ 2.0.0
|   |-- Time
|   |-- WiFi @ 2.0.0
|   |-- WiFiClientSecure @ 2.0.0
|   |   |-- WiFi @ 2.0.0
|   |-- FS @ 2.0.0
|   |-- Update @ 2.0.0
|   |-- SPI @ 2.0.0
|   |-- SD @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |   |-- SPI @ 2.0.0
|   |-- SD_MMC @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |-- SPIFFS @ 2.0.0
|   |   |-- FS @ 2.0.0
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libca6\WiFi\WiFi.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libca6\WiFi\WiFiAP.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libca6\WiFi\WiFiClient.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libca6\WiFi\WiFiGeneric.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libca6\WiFi\WiFiMulti.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libca6\WiFi\WiFiSTA.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libca6\WiFi\WiFiScan.cpp.o
In file included from C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/Firebase.h:63,
                 from C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/FirebaseESP32.h:50,
                 from src/main.cpp:2:
C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/FB_Utils.h: In member function 'time_t UtilsClass::getTime()':
C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/FB_Utils.h:1158:18: error: 'time' was not declared in this scope
             tm = time(nullptr);
                  ^~~~
C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/FB_Utils.h:1158:18: note: suggested alternative: 'trim'
             tm = time(nullptr);
                  ^~~~
                  trim
*** [.pio\build\esp32doit-devkit-v1\src\main.cpp.o] Error 1
==================================== [FAILED] Took 12.51 seconds ====================================
El proceso del terminal "C:\Users\NOAR\.platformio\penv\Scripts\platformio.exe 'run'" finalizó con el código de salida 1.

Las tareas reutilizarán el terminal, presione cualquier tecla para cerrarlo.

> Executing task in folder Firebase_01: C:\Users\NOAR\.platformio\penv\Scripts\platformio.exe run <

Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (4.2.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20002.0 (2.0.2)
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 50 compatible libraries
Scanning dependencies...
Dependency Graph
|-- WiFi @ 2.0.0
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libca6\WiFi\WiFiServer.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libca6\WiFi\WiFiUdp.cpp.o
Archiving .pio\build\esp32doit-devkit-v1\libca6\libWiFi.a
Indexing .pio\build\esp32doit-devkit-v1\libca6\libWiFi.a
Linking .pio\build\esp32doit-devkit-v1\firmware.elf
Retrieving maximum program size .pio\build\esp32doit-devkit-v1\firmware.elf
Checking size .pio\build\esp32doit-devkit-v1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.9% (used 16148 bytes from 327680 bytes)
Flash: [==        ]  15.7% (used 206209 bytes from 1310720 bytes)
Building .pio\build\esp32doit-devkit-v1\firmware.bin
esptool.py v3.3
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
==================================== [SUCCESS] Took 12.86 seconds ====================================
Las tareas reutilizarán el terminal, presione cualquier tecla para cerrarlo.

> Executing task in folder Firebase_01: C:\Users\NOAR\.platformio\penv\Scripts\platformio.exe run <

Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (4.2.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20002.0 (2.0.2)
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 50 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Firebase ESP32 Client @ 4.0.0
|   |-- Ethernet @ 2.0.0
|   |   |-- WiFi @ 2.0.0
|   |-- Time
|   |-- WiFi @ 2.0.0
|   |-- WiFiClientSecure @ 2.0.0
|   |   |-- WiFi @ 2.0.0
|   |-- FS @ 2.0.0
|   |-- Update @ 2.0.0
|   |-- SPI @ 2.0.0
|   |-- SD @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |   |-- SPI @ 2.0.0
|   |-- SD_MMC @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |-- SPIFFS @ 2.0.0
|   |   |-- FS @ 2.0.0
|-- WiFi @ 2.0.0
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libb65\Ethernet\ETH.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib999\Time\DateStrings.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib999\Time\Time.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib28c\WiFiClientSecure\WiFiClientSecure.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib28c\WiFiClientSecure\ssl_client.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib93f\FS\FS.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib93f\FS\vfs_api.cpp.o
In file included from C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/Firebase.h:63,
                 from C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/FirebaseESP32.h:50,
                 from src/main.cpp:3:
C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/FB_Utils.h: In member function 'time_t UtilsClass::getTime()':
C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/FB_Utils.h:1158:18: error: 'time' was not declared in this scope
             tm = time(nullptr);
                  ^~~~
C:/Users/NOAR/.platformio/lib/Firebase ESP32 Client/src/FB_Utils.h:1158:18: note: suggested alternative: 'trim'
             tm = time(nullptr);
                  ^~~~
                  trim
Compiling .pio\build\esp32doit-devkit-v1\lib0ea\Update\HttpsOTAUpdate.cpp.o
*** [.pio\build\esp32doit-devkit-v1\src\main.cpp.o] Error 1
==================================== [FAILED] Took 14.45 seconds ====================================
El proceso del terminal "C:\Users\NOAR\.platformio\penv\Scripts\platformio.exe 'run'" finalizó con el código de salida 1.

Las tareas reutilizarán el terminal, presione cualquier tecla para cerrarlo.

Despues de haberme dado por vencido, comenze instalando una version anterior de la libreria, el IDE de arduino compila sin problemas la version 4.0 de la libreria Firebase ESP32 Client, pero vs code y platformio, funciona bien con versiones como la 3.17.6.

He encontrado varias incompatibilidades. Cosas que funcionan en IDE no lo hacen en VSC y vice versa.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.