Implicit dependency `.pio\build\native\None' not found

Recently I can no longer run unit tests because the error message

*** [.pio\build\native\program.exe] Implicit dependency .pio\build\native\None' not found, needed by target .pio\build\native\program.exe’.

appears.
Now I have created a minimal project, the upload works fine but the unit test also shows the same error.
Does anyone have any idea what

OS: Windows 11 Pro, Version 21H2
IDE: Visual Studio Code, Version: 1.66.2
PlatformIO: Code: 6.0.1, Home: 3.4.1, platforms → native, Version: 1.2.0

platformio.ini -----------------------------

; [env:esp32doit-devkit-v1]
; platform = espressif32
; board = esp32doit-devkit-v1
; framework = arduino
; monitor_speed = 115200


[env:native]
platform = native
test_filter = test_desktop
monitor_speed = 115200
; monitor_filters = log2file, default
lib_compat_mode = off ; Diese Definition stellt sicher, dass #include <gtest/gtest.h> funktioniert 
lib_deps = 
	google/googletest@^1.10.0
test_framework = googletest

Project Structure

D:.
├───.pio
│   ├───build
│   │   └───native
│   │       ├───lib37a
│   │       │   └───googletest
│   │       │       ├───googlemock
│   │       │       │   └───src
│   │       │       └───googletest
│   │       │           └───src
│   │       └───test
│   │           └───test_desktop
│   └───libdeps
│       └───native
│           ├───googletest
│           │   ├───googlemock
│           │   │   ├───include
│           │   │   │   └───gmock
│           │   │   │       └───internal
│           │   │   │           └───custom
│           │   │   └───src
│           │   └───googletest
│           │       ├───include
│           │       │   └───gtest
│           │       │       └───internal
│           │       │           └───custom
│           │       └───src
│           └───Unity
│               ├───.github
│               │   └───workflows
│               ├───auto
│               ├───examples
│               │   ├───example_1
│               │   │   ├───src
│               │   │   └───test
│               │   │       └───test_runners
│               │   ├───example_2
│               │   │   ├───src
│               │   │   └───test
│               │   │       └───test_runners
│               │   ├───example_3
│               │   │   ├───helper
│               │   │   ├───src
│               │   │   └───test
│               │   └───example_4
│               │       ├───src
│               │       ├───subprojects
│               │       └───test
│               │           └───test_runners
│               └───src
├───.vscode
├───include
├───lib
│   └───calc
├───src
└───test
    └───test_desktop

Can you upload the project (or a minimal version of it) that reproduces this error? I don’t immediately see a fault in your platformio.ini or folder structure.

A small tip that i can give is that you can do a clean rebuild by removing the .pio folder entirely and building again. It will try to pull the new versions of the libraries then too.

It seems the program was written at a time where 1.10.0 was the most recent one – now it will download 1.11.0. If you want 1.10.0, remove the ^ in that expression and do a clean rebuild per instructions per above.

Thanks for your feedback.
I uploaded the mini project to GitHub. Here is the link

The test will probably work for you, the question then would be what do I need to uninstall, clean and reinstall on my system

Actually it’s the same for me.

$ pio test -e native -vvv
Collected 1 tests (test_desktop)

Processing test_desktop in native environment
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Building...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ off
Found 2 compatible libraries
Scanning dependencies...
Dependency Graph
|-- googletest @ 1.11.0 (License: BSD-3-Clause, Path: /home/max/temp/MiniTest/.pio/libdeps/native/googletest)
|-- calc (License: Unknown, Path: /home/max/temp/MiniTest/lib/calc)
Building in test mode
*** [.pio/build/native/program] Implicit dependency `.pio/build/native/None' not found, needed by target `.pio/build/native/program'.
Building stage has failed, see errors above. Use `pio test -vvv` option to enable verbose output.
--------------------------------------------------------------- native:test_desktop [ERRORED] Took 0.35 seconds ---------------------------------------------------------------

=================================================================================== SUMMARY ===================================================================================
Environment          Test          Status    Duration
-------------------  ------------  --------  ------------
esp32doit-devkit-v1  test_desktop  SKIPPED
native               test_desktop  ERRORED   00:00:00.352
================================================================== 1 test cases: 0 succeeded in 00:00:00.352 ==================================================================

(and that is with the very latest version obtained with pio upgrade --dev in the PlatformIO CLI).

Maybe @ivankravets has an idea?

1 Like

Fixed in the latest PIO Core. A temporary solution is to remove the custom googletest library from lib_deps. You don’t need to declare it, PlatformIO does this automatically for you.

The MiniTest project and some other smaller projects can now be tested without any problems, thanks for your help. Unfortunately, the test for my large project still breaks off with the same error message. I’ve been trying to figure out what could be causing this error for days now with no success. One possibility could have been that some external libraries are used in the large project. So I extended the MiniTest project with external libraries, but everything still works fine there.
Do you have an idea in which cases this missing file can occur? Is there a way to trace or debug the build process leading to this None file? I am grateful for every hint.

Sure, use pio test -vvv command from PlatformIO Core CLI (terminal icon on the bottom status bar).

Thank you very much for the hint. But the output doesn’t help me either. The last library is the etl, which I also included in the MiniTest project. So here’s the expression. Can you spot anything that isn’t consistent?

PS D:\sources\elektronik_heizung\Heizung\sw\heizung_app> pio test -vvv
Collected 1 tests (test_desktop)

Processing test_desktop in native environment
-----------------------------------------------------------------------------------------------------------------------------------------
Building...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ off
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|-- aktor (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\aktor)
|   |-- db (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\db)
|   |   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|-- http (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\http)
|   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |-- db (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\db)
|   |   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|-- persisting (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\persisting)
|   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|-- sensADC (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\sensADC)
|   |-- db (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\db)
|   |   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|-- sensDigi (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\sensDigi)
|   |-- db (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\db)
|   |   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|-- history (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\history)
|   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |-- db (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\db)
|   |   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|   |-- http (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\http)
|   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |   |-- db (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\db)
|   |   |   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |   |   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |   |   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|-- settings (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\settings)
|   |-- db (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\db)
|   |   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|   |-- persisting (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\persisting)
|   |   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|-- db (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\db)
|   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |-- globals (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\globals)
|   |   |-- ArduinoJson @ 6.19.4 (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\ArduinoJson)
|   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
|-- googletest @ 1.11.0 (License: BSD-3-Clause, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\googletest)
|-- screenLayers (License: Unknown, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\lib\screenLayers)
|   |-- Embedded Template Library @ 20.28.0+sha.752d9ad (License: MIT, URI: git+https://github.com/ETLCPP/etl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\Embedded Template Library)
|   |-- lvgl @ 8.3.0-dev+sha.6ad52a7 (License: MIT, URI: git+https://github.com/lvgl/lvgl, Path: D:\sources\elektronik_heizung\Heizung\sw\heizung_app\.pio\libdeps\native\lvgl)
Building in test mode
*** [.pio\build\native\program.exe] Implicit dependency `.pio\build\native\None' not found, needed by target `.pio\build\native\program.exe'.
Building stage has failed, see errors above. Use `pio test --verbose` option to enable verbose output.
  1. Do you use the latest PIO Core dev? pio upgrade --dev
  2. Did you remove googletest from lib_deps?

You are my hero of the day, thank you very much. pio upgrade --dev solved the problem. Have a nice day.

1 Like