Building with non-release platform package (framework) results in dependency assertion error


First: I have been working with the main release versions of the “arduino” framework for the “nordicnrf52” platform successfully for the past few months. However, due to several reasons,
I included my own fork of the Adafruit nrf52 Arduino Framework via the paltform_packages option via:

platform_packages = 
	framework-arduinoadafruitnrf52 @

However, this resulted in an Assertion Error during dependency scanning (after the framework was installed):

Processing sensotronic2 (board: adafruit_feather_nrf52840; platform: nordicnrf52; framework: arduino)
AssertionError: Traceback (most recent call last):
  File "C:\.platformio\penv\lib\site-packages\platformio\", line 103, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "C:\.platformio\penv\lib\site-packages\click\", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\.platformio\penv\lib\site-packages\click\", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\.platformio\penv\lib\site-packages\platformio\", line 85, in invoke
    return super().invoke(ctx)
  File "C:\.platformio\penv\lib\site-packages\click\", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\.platformio\penv\lib\site-packages\click\", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\.platformio\penv\lib\site-packages\click\", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\.platformio\penv\lib\site-packages\click\", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "C:\.platformio\penv\lib\site-packages\platformio\run\", line 145, in cli
  File "C:\.platformio\penv\lib\site-packages\platformio\run\", line 198, in process_env
    result["succeeded"] = EnvironmentProcessor(
  File "C:\.platformio\penv\lib\site-packages\platformio\run\", line 81, in process
  File "C:\.platformio\penv\lib\site-packages\platformio\package\commands\", line 131, in install_project_env_dependencies
    _install_project_env_platform(project_env, options),
  File "C:\.platformio\penv\lib\site-packages\platformio\package\commands\", line 148, in _install_project_env_platform
  File "C:\.platformio\penv\lib\site-packages\platformio\package\manager\", line 62, in install
  File "C:\.platformio\penv\lib\site-packages\platformio\platform\", line 76, in install_required_packages
    self.install_package(name, force=force)
  File "C:\.platformio\penv\lib\site-packages\platformio\platform\", line 70, in install_package
    return or self.get_package_spec(name), force=force)
  File "C:\.platformio\penv\lib\site-packages\platformio\package\manager\", line 47, in install
    pkg = self._install(spec, skip_dependencies=skip_dependencies, force=force)
  File "C:\.platformio\penv\lib\site-packages\platformio\package\manager\", line 91, in _install
    self.install_dependencies(pkg, print_header=False)
  File "C:\.platformio\penv\lib\site-packages\platformio\package\manager\", line 139, in install_dependencies
  File "C:\.platformio\penv\lib\site-packages\platformio\package\manager\", line 151, in install_dependency
    dependency_compatibility = PackageCompatibility.from_dependency(dependency)
  File "C:\.platformio\penv\lib\site-packages\platformio\package\", line 72, in from_dependency
    assert isinstance(dependency, dict)


An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `python -m pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section

* Report this problem to the developers


I also tried using the latest official version from the main repository ( GitHub - adafruit/Adafruit_nRF52_Arduino: Adafruit code for the Nordic nRF52 BLE SoC on Arduino with and without git-hash of the last commit ) with the same message, as well as upgrading to the latest dev version of platformio, full clean, manual platform + framework deletion etc.

My first guess was that there somewhere is some kind of dependency that restricts its compatibility to a specific release. However, when copying the framework’s project to a different (unreleated to the original) git repository and using that, it magically works. With the forked repository, I also noticed I can no longer perform the PIO Task Dependencies - Update, which causes the message:

CSBaseException: VCS: Could not receive an output from `['git', 'branch']` command ({'out': '', 'err': 'fatal: not a git repository (or any of the parent directories): .git\n', 'returncode': 128})

Any hints what could cause this / how to fix it would be greatly appreciated.

But that one doesn’t even have a package.json at the root like a framework-arduinoadafruitnrf52 package should have? That’s gonna mess a lot things up. At least add the previous one and update the version.

  "name": "framework-arduinoadafruitnrf52",
  "version": "1.10300.0",
  "description": "Arduino Wiring-based Framework for Nordic Semiconductor nRF52 BLE SoC",
  "keywords": [
    "nordic semiconductor",
  "repository": {
    "type": "git",
    "url": ""
1 Like

Wow, that was quick!

That is true - and interestingly, this now works although the original repository also did not have such a file. I now added

    "name": "framework-arduinoadafruitnrf52",
    "version": "1.10500.0",
    "description": "Arduino Wiring-based Framework for Nordic Semiconductor nRF52 BLE SoC",
    "keywords": [
        "nordic semiconductor",
    "repository": {
        "type": "git",
        "url": ""

but now have the issue that one of the (as git-submodule) included libraries (Adafruit/nRF_Crypto) is not found during building (“Adafruit_nRFCrypto.h: No such file or directory”) - this also works with the released version found in the platformio repository.

I guess since they are included as submodules there is no need to list them as dependencies in the package.json (which I also tried to no success)?

Sorry for the questions, but I am having a hard time finding concrete information on how to build a platform package (or in this matter: adapt an existing ArduinoIDE-one).

PlatformIO should automatically download any submodules recursively. From the previous installation attempts, the installation folder may be messed up. Can you delete any C:\Users\<user>\.platformio\packages\framework-arduinoadafruitnrf52* folder and then press “Build” again in VSCode?

Thanks for the suggestion - I already did so previously without success. Plus, I checked both the logs and actual files that the submodules got downloaded correctly.


"build": {

also did not bring success. Additionally, I crosschecked with some other frameworks and found that they also include some libraries in /libraries but did not explicitly list anything special in package.json.

Link to my package.json:

Link to the libraries folder with nRFCrypto as submodule:

But C:\Users\<user>\.platformio\packages\framework-arduinoadafruitnrf52\libraries\Adafruit_nRFCrypto does exist?

Note that PlatformIO has put a custom library.json and in this folder to fix building issues.

    "name": "Adafruit nRFCrypto",
    "build": {
        "extraScript": ""
import os


# An extra script is required to properly handle extra link flags set in
# the `` file
if env.BoardConfig().get("build.mcu", "").startswith("nrf5284"):

That just fixes linking though. I remember for my fork I had to do additional logic –

Yes, the nRFCrypto library does exist.

What do you mean with “PlatformIO has put a custom library.json”? The original (and included in the non-forked-by-you) Adafruit_nRFCrypto dependency does not have that. What logic you changed is a bit hard to follow since you just added the whole library instead of a change history - but I also don’t think there is much needed in terms of logic since it works in the original library with my board.

Side-note: I added lib_ldf_mode=deep in the application platform.ini [env] which seems to have fixed the crypto dependency, just now breaks a different (application, not framework-)library dependency/linking (again, it gets downloaded correctly but not found during compilation ;))

Just look at the latest package version ( and open libraries\Adafruit_nRFCrypto and compare to

1 Like

sorry for my late response but I had some higher priorities in the meantime. I tried several things but the only successful thing ended up being replacing the nRFCrypto submodule with your patched version (although I don’t know what the “additional logic” beyond the linking fixes is). This builds!

I guess as long as the nrfCrypto library does not receive significant updates that are then required by the nrf52 framework, this is fine. Let’s hope this won’t be the case? :upside_down_face:

Thanks so much for your amazing support.