Page 1 of 1

Cannot process component requirements. Multiple candidates to satisfy project requirements

Posted: Wed Aug 28, 2024 7:38 am
by Dharanesh

Code: Select all

"$ENV{IDF_PATH}/components/esp-homekit-sdk/components/homekit"
am alredy using the apple home kit in my ESP-IDF project

now i want to add the

Code: Select all

"${ESP_MATTER_PATH}/components"
"${ESP_MATTER_PATH}/examples/common"
"${MATTER_SDK_PATH}/config/esp32/components"
${extra_components_dirs_append}
matter protocol in the project

when i head to add this

CMake Error at /home/dharanesh/esp/esp-idf/tools/cmake/component.cmake:251 (message):
ERROR: Cannot process component requirements. Multiple candidates to
satisfy project requirements:

requirement: "json_generator" candidates: "espressif__json_generator, json_generator"
requirement: "json_parser" candidates: "json_parser, espressif__json_parser"
i got this error how to resolve it

and this is my components CmakeLists.txt

Code: Select all

cmake_minimum_required(VERSION 3.16)
  
  if(NOT DEFINED ENV{ESP_MATTER_PATH})
      message(FATAL_ERROR "Please set ESP_MATTER_PATH to the path of esp-matter repo")
  endif(NOT DEFINED ENV{ESP_MATTER_PATH})
  
  set(PROJECT_VER "1.0")
  set(PROJECT_VER_NUMBER 1)
  
  set(ESP_MATTER_PATH $ENV{ESP_MATTER_PATH})
  set(MATTER_SDK_PATH ${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip)
  
  include($ENV{IDF_PATH}/tools/cmake/project.cmake)
  include(${ESP_MATTER_PATH}/examples/common/cmake_common/components_include.cmake)
  
  set(EXTRA_COMPONENT_DIRS 
      "$ENV{IDF_PATH}/components/esp-aws-iot/libraries/coreMQTT"
      "$ENV{IDF_PATH}/components/esp-aws-iot/libraries/common/posix_compat"
      "$ENV{IDF_PATH}/components/esp-aws-iot/libraries/backoffAlgorithm"	
      "$ENV{IDF_PATH}/components/esp-homekit-sdk/components/homekit"
      "$ENV{IDF_PATH}/components/esp-homekit-sdk/examples/common"
      "${ESP_MATTER_PATH}/components"
      "${ESP_MATTER_PATH}/examples/common"
      "${MATTER_SDK_PATH}/config/esp32/components"
      ${extra_components_dirs_append})
  
  message(STATUS "EXTRA_COMPONENT_DIRS is : ${EXTRA_COMPONENT_DIRS}")
  
  project(code-flow)
  
  idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-Wno-overloaded-virtual" APPEND)
  idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
  idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND)
  
  target_add_binary_data(${CMAKE_PROJECT_NAME}.elf "main/soul/root_cert_auth.crt" TEXT)
  target_add_binary_data(${CMAKE_PROJECT_NAME}.elf "main/soul/client.crt" TEXT)
  target_add_binary_data(${CMAKE_PROJECT_NAME}.elf "main/soul/client.key" TEXT)
  
  set(PARTITION_TABLE_CSV ${CMAKE_CURRENT_LIST_DIR}/partitions.csv)
  set(CMAKE_VERBOSE_MAKEFILE ON)
  set_property(GLOBAL APPEND PROPERTY EXTRA_PARTITION_TABLES ${PARTITION_TABLE_CSV})