Developing Matter 1.0 with nRF SDK build failes with "fatal error: jni.h: No such file or directory"

I am following the "Developing Matter 1.0 products with nRF Connect SDK" Video on YT and try to build a Matter device. I have everything already installed the SDK, VSCode etc. I was already working with it before. I updated the nRF connect SDK to be v2.3.0 and also everything else in on the latest version.

If I try to just build the plain matter sample of the light_bulb, it failes with the following error:


c:\...\modules\lib\matter\src\lib\support\JniReferences.cpp:18:10: fatal error: jni.h: No such file or directory
18 | #include <jni.h>
| ^~~~~~~

Is there something missing in my setup? where should I find this jni.h file? I assume this should be just there together with the SDK and I do not have to change anything.

Any suggestions?

Parents
  • Hi,

    I tried updating SDK and toolchain already and I tried again, does not fix it.

    1. Which OS are you running?
      Windows

    2. Which device(s) are you building for?
      1. Are you building from command line or from the VsCode extension?

        Building for nRF52840DK via VSCode extension
         
    3. Have you made any modifications to the SDK, or is the SDK instance pristine, and opened from the toolchain manager?

      no - I freshly installed it just for this. I did had an older version running but in the VSCode extension I am selecting the new one

    4. Have you been able to build Matter samples in older instances of the SDK? For instance nRF Connect v2.2.0?
      No I have not tried that

    5. Can you run "generate support information" from the extension (v2.3.0) and add the information here? 

      {
        "platform": {
          "os": "win32",
          "osVersion": "Windows 10 Pro",
          "osKernel": "10.0.19045",
          "vscode": "1.76.2",
          "electron": "19.1.11",
          "node": "v16.14.2"
        },
        "system": {
          "date": "2023-03-21T17:58:43.982Z",
          "vscodeRoot": "c:\\Users\\Informatic0re\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
          "nrfConnectForDesktopInstalled": true,
          "vscodeUptime": "00:00:42",
          "osUptime": "02:33:17",
          "cpu": {
            "model": "AMD Ryzen 5 5600 6-Core Processor",
            "speed": "3500 MHz",
            "count": 6
          },
          "memory": {
            "total": "31.91 GB",
            "free": "22.50 GB"
          }
        },
        "workspace": {
          "name": "Untitled (Workspace)",
          "workspaceFile": "1679351572306",
          "folders": [
            "c:\\Users\\Informatic0re\\Documents\\workspace\\OpenThings\\matter_test",
            "c:\\Users\\Informatic0re\\ncs\\v2.3.0\\nrf\\samples\\matter\\light_switch"
          ]
        },
        "extensions": {
          "internal": {
            "nordic-semiconductor.nrf-connect": {
              "version": "2023.2.56",
              "path": "c:\\Users\\Informatic0re\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.2.56-win32-x64",
              "isActive": true
            },
            "nordic-semiconductor.nrf-terminal": {
              "version": "2022.11.29",
              "path": "c:\\Users\\Informatic0re\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.11.29",
              "isActive": true
            },
            "nordic-semiconductor.nrf-devicetree": {
              "version": "2022.11.153",
              "path": "c:\\Users\\Informatic0re\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2022.11.153",
              "isActive": true
            },
            "nordic-semiconductor.nrf-kconfig": {
              "version": "2022.11.50",
              "path": "c:\\Users\\Informatic0re\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2022.11.50",
              "isActive": true
            }
          },
          "external": {
            "marus25.cortex-debug": null,
            "ms-vscode.cpptools": "1.14.4",
            "ms-vscode-remote.remote-wsl-recommender": "0.0.19",
            "ms-vscode.js-debug": "1.76.1",
            "ms-vscode.js-debug-companion": "1.0.18",
            "ms-vscode.vscode-js-profile-table": "1.0.3",
            "aldijav.golangwithdidi": "0.0.1",
            "espressif.esp-idf-extension": "1.6.0",
            "formulahendry.code-runner": "0.12.0",
            "golang.go": "0.38.0",
            "MS-CEINTL.vscode-language-pack-de": "1.76.2023030809",
            "ms-python.isort": "2022.8.0",
            "ms-python.python": "2023.4.1",
            "ms-python.vscode-pylance": "2023.3.20",
            "ms-toolsai.jupyter": "2023.2.1200692131",
            "ms-toolsai.jupyter-keymap": "1.1.0",
            "ms-toolsai.jupyter-renderers": "1.0.15",
            "ms-toolsai.vscode-jupyter-cell-tags": "0.1.8",
            "ms-toolsai.vscode-jupyter-slideshow": "0.1.5",
            "ms-vscode-remote.remote-wsl": "0.76.1",
            "ms-vscode.cmake-tools": "1.13.45",
            "ms-vscode.cpptools-extension-pack": "1.3.0",
            "ms-vscode.cpptools-themes": "2.0.0",
            "ms-vscode.vscode-serial-monitor": "0.9.0",
            "nhoizey.gremlins": "0.26.0",
            "platformio.platformio-ide": "3.1.1",
            "plorefice.devicetree": "0.1.1",
            "premparihar.gotestexplorer": "0.1.13",
            "quicktype.quicktype": "12.0.46",
            "TobiasTimm.matter": "1.0.0",
            "toit.toit": "1.6.6",
            "trond-snekvik.gnu-mapfiles": "1.1.0",
            "twxs.cmake": "0.0.17",
            "vscode-icons-team.vscode-icons": "12.2.0",
            "zxh404.vscode-proto3": "0.5.5"
          }
        },
        "tools": {
          "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gcc.exe": "0.15.2",
          "C:\\Program Files (x86)\\SEGGER\\JLink\\JLink.exe": "7.66a",
          "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.18.1",
          "C:\\Python39\\Scripts\\nrfutil.exe": null,
          "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\cmake.exe": "3.20.5",
          "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\Scripts\\west.exe": "0.14.0",
          "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\python.exe": "3.8.2",
          "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\ninja.exe": "1.9.0",
          "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\gperf.exe": "3.1",
          "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\dtc.exe": "1.4.7",
          "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\gn.exe": "2082",
          "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\mingw64\\bin\\git.exe": "2.37.3.windows.1",
          "gdbPath": "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb.exe"
        },
        "sdks": [
          {
            "version": "1.5.0-rc1",
            "path": "c:\\Users\\Informatic0re\\ncs\\v1.5.0-rc1"
          },
          {
            "version": "Zephyr 2.7.0-rc4",
            "path": "c:\\Users\\Informatic0re\\Documents\\workspace\\zephyrproject"
          },
          {
            "version": "2.3.0",
            "path": "c:\\Users\\Informatic0re\\ncs\\v2.3.0"
          }
        ],
        "toolchains": [
          {
            "version": "1.5.0",
            "path": "c:\\Users\\Informatic0re\\ncs\\v1.5.0-rc1\\toolchain"
          },
          {
            "version": "2.3.0",
            "path": "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0"
          }
        ],
        "connectedDevices": [
          {
            "serialNumber": "801029576"
          }
        ],
        "deviceProviders": [
          "nrfjprog"
        ],
        "config": {
          "nordic-semiconductor.nrf-connect": {
            "topdir": "${nrf-connect.sdk:2.3.0}",
            "toolchain": {
              "path": "${nrf-connect.toolchain:2.3.0}"
            },
            "ozonePath": "",
            "applications": [
              "${workspaceFolder}",
              "c:\\Users\\Informatic0re\\ncs\\v2.3.0\\nrf\\samples\\matter\\light_switch"
            ],
            "applicationOptions": {},
            "kconfig": {
              "interface": "kconfig",
              "executeInDefaultShell": false
            },
            "welcome": {
              "showOnStartup": true
            },
            "west": {
              "env": {
                "$base": "terminal"
              }
            },
            "boardRoots": [],
            "enableTelemetry": true,
            "taskBindings": {},
            "debugging": {
              "backend": "nRF Debug",
              "flash": true,
              "bindings": {}
            },
            "activeAppFollowActiveEditor": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "terminalMode": "character",
            "scrollBack": 1000
          }
        },
        "environment": {
          "westExe": "west",
          "westEnv": {
            "ELECTRON_RUN_AS_NODE": "1",
            "HOME": "C:\\Users\\Informatic0re",
            "HOMEDRIVE": "C:",
            "HOMEPATH": "\\Users\\Informatic0re",
            "Path": "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\mingw64\\bin;c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\mingw64\\libexec\\git-core;c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin;c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin;c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\arm-zephyr-eabi\\bin;c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\Scripts;C:\\Python39\\Scripts\\;C:\\Python39\\;C:\\Program Files\\Oculus\\Support\\oculus-runtime;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Git\\cmd;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Program Files\\PuTTY\\;E:\\Program Files\\nodejs\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\balena-cli\\bin;C:\\Program Files\\Go\\bin;C:\\Program Files\\usbipd-win\\;C:\\Program Files\\CMake\\bin;C:\\MinGW\\bin;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Informatic0re\\Documents\\workspace\\esp-idf\\tools;C:\\Program Files (x86)\\GNU Arm Embedded Toolchain\\10 2020-q4-major\\bin;C:\\Program Files (x86)\\GNU Tools ARM Embedded\\6 2017-q2-update\\bin;C:\\Users\\Informatic0re\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Informatic0re\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Informatic0re\\AppData\\Roaming\\npm;C:\\Users\\Informatic0re\\AppData\\Local\\Microsoft\\WindowsApps;C:\\hugo;E:\\Exercism;C:\\Users\\Informatic0re\\go\\bin;C:\\Users\\Informatic0re\\AppData\\Local\\gitkraken\\bin;C:\\Program Files (x86)\\GnuWin32\\bin;C:\\Commands;C:\\Users\\Informatic0re\\AppData\\Local\\Programs\\toitware;C:\\Users\\Informatic0re\\AppData\\Local\\Programs\\jaguar;C:\\Program Files (x86)\\Nmap;C:\\Python39\\Scripts;C:\\Python39\\;C:\\Users\\Informatic0re\\go\\bin",
            "ZEPHYR_BASE": "c:\\Users\\Informatic0re\\ncs\\v2.3.0\\zephyr",
            "GNUARMEMB_TOOLCHAIN_PATH": "C:\\GNUToolchain\\10-2020-q4-major",
            "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
            "ZEPHYR_SDK_INSTALL_DIR": "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\zephyr-sdk",
            "PYTHONPATH": "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin;c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\Lib;c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin\\Lib\\site-packages",
            "Python3_ROOT": "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\bin"
          },
          "inherited": {
            "ELECTRON_RUN_AS_NODE": "1",
            "HOME": "C:\\Users\\Informatic0re",
            "HOMEDRIVE": "C:",
            "HOMEPATH": "\\Users\\Informatic0re",
            "Path": "C:\\Python39\\Scripts\\;C:\\Python39\\;C:\\Program Files\\Oculus\\Support\\oculus-runtime;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Git\\cmd;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Program Files\\PuTTY\\;E:\\Program Files\\nodejs\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\balena-cli\\bin;C:\\Program Files\\Go\\bin;C:\\Program Files\\usbipd-win\\;C:\\Program Files\\CMake\\bin;C:\\MinGW\\bin;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Informatic0re\\Documents\\workspace\\esp-idf\\tools;C:\\Program Files (x86)\\GNU Arm Embedded Toolchain\\10 2020-q4-major\\bin;C:\\Program Files (x86)\\GNU Tools ARM Embedded\\6 2017-q2-update\\bin;C:\\Users\\Informatic0re\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Informatic0re\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Informatic0re\\AppData\\Roaming\\npm;C:\\Users\\Informatic0re\\AppData\\Local\\Microsoft\\WindowsApps;C:\\hugo;E:\\Exercism;C:\\Users\\Informatic0re\\go\\bin;C:\\Users\\Informatic0re\\AppData\\Local\\gitkraken\\bin;C:\\Program Files (x86)\\GnuWin32\\bin;C:\\Commands;C:\\Users\\Informatic0re\\AppData\\Local\\Programs\\toitware;C:\\Users\\Informatic0re\\AppData\\Local\\Programs\\jaguar;C:\\Program Files (x86)\\Nmap;C:\\Python39\\Scripts;C:\\Python39\\;C:\\Users\\Informatic0re\\go\\bin",
            "PATH": "C:\\Python39\\Scripts\\;C:\\Python39\\;C:\\Program Files\\Oculus\\Support\\oculus-runtime;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Git\\cmd;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Program Files\\PuTTY\\;E:\\Program Files\\nodejs\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\balena-cli\\bin;C:\\Program Files\\Go\\bin;C:\\Program Files\\usbipd-win\\;C:\\Program Files\\CMake\\bin;C:\\MinGW\\bin;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Informatic0re\\Documents\\workspace\\esp-idf\\tools;C:\\Program Files (x86)\\GNU Arm Embedded Toolchain\\10 2020-q4-major\\bin;C:\\Program Files (x86)\\GNU Tools ARM Embedded\\6 2017-q2-update\\bin;C:\\Users\\Informatic0re\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Informatic0re\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Informatic0re\\AppData\\Roaming\\npm;C:\\Users\\Informatic0re\\AppData\\Local\\Microsoft\\WindowsApps;C:\\hugo;E:\\Exercism;C:\\Users\\Informatic0re\\go\\bin;C:\\Users\\Informatic0re\\AppData\\Local\\gitkraken\\bin;C:\\Program Files (x86)\\GnuWin32\\bin;C:\\Commands;C:\\Users\\Informatic0re\\AppData\\Local\\Programs\\toitware;C:\\Users\\Informatic0re\\AppData\\Local\\Programs\\jaguar;C:\\Program Files (x86)\\Nmap;C:\\Python39\\Scripts;C:\\Python39\\;C:\\Users\\Informatic0re\\go\\bin",
            "GNUARMEMB_TOOLCHAIN_PATH": "C:\\GNUToolchain\\10-2020-q4-major",
            "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb"
          },
          "toolchainPath": "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0",
          "toolchainBinPath": "c:\\Users\\Informatic0re\\ncs\\toolchains\\v2.3.0\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin",
          "toolchainVersion": "2.3.0"
        },
        "terminal": {
          "shell": "C:\\Program Files\\Git\\bin\\bash.exe",
          "defaultProfile": null
        }
      }


    6. Can you paste the entire build log that results in the missing header error you pasted in the original ticket?

      it seems to be to long? I can not add the log or a file with the log here



  • Thank you for answering these questions,

    Informatic0re said:
    Can you paste the entire build log that results in the missing header error you pasted in the original ticket?

    it seems to be to long? I can not add the log or a file with the log here

    You should be able to add the build log in a code snippet as shown in the image below:
      

    Based on the answers you've given everything seems to be correctly installed and similar enough to mine that I would expect it to work. I suspect that the header error might be caused by something else and having the build log available would be very helpful to exclude if this is the case or not 

    If the log is too long to add in a snippet as well, you may also add it to a .txt file and uppload it here

    Kind regards,
    Andreas

Reply
  • Thank you for answering these questions,

    Informatic0re said:
    Can you paste the entire build log that results in the missing header error you pasted in the original ticket?

    it seems to be to long? I can not add the log or a file with the log here

    You should be able to add the build log in a code snippet as shown in the image below:
      

    Based on the answers you've given everything seems to be correctly installed and similar enough to mine that I would expect it to work. I suspect that the header error might be caused by something else and having the build log available would be very helpful to exclude if this is the case or not 

    If the log is too long to add in a snippet as well, you may also add it to a .txt file and uppload it here

    Kind regards,
    Andreas

Children
No Data
Related