Wrong Version Of Library Installed

this is my 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
[env:old_nitromax_android_access]
platform = espressif32
board = nodemcu-32s
framework = arduino
board_build.partitions = no_ota.csv
monitor_speed = 115200
upload_speed = 921600
lib_deps =
  bblanchon/ArduinoJson@^6.18.5
  adafruit/Adafruit Thermal Printer Library@1.2.1

but when I compile my code, platform io will install latest version of ArduinoJson
this is library.json look like

{
  "name": "ArduinoJson",
  "keywords": "json, rest, http, web",
  "description": "A simple and efficient JSON library for embedded C++. ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation.",
  "homepage": "---",
  "repository": {
    "type": "git",
    "url": "---"
  },
  "version": "6.19.3",
  "authors": {
    "name": "Benoit Blanchon",
    "url": "https://blog.benoitblanchon.fr"
  },
  "exclude": [
    ".github",
    "extras"
  ],
  "frameworks": "*",
  "platforms": "*",
  "build": {
    "libArchive": false
  }
}

Everything is correct. This semantic version (semver) of ^6.18.5 matches the newest possible version 6.x.x. This is as documented.

  • ^1.2.3 - any compatible version (new functionality in a backwards compatible manner and patches are allowed, 1.x.x). RECOMMENDED

If you want exactly 6.18.5, remove the ^. If you want to allow patch updates (6.18.x), replace ^ with a ~.

thanks a lot
you save my day :sweat_smile:

1 Like