connectedhomeip icon indicating copy to clipboard operation
connectedhomeip copied to clipboard

[Build] Compiling Android v1.3.0.0 on macos: ld: error: undefined symbol xxx

Open kuyu132 opened this issue 1 year ago • 2 comments

Build issue(s)

ld: error: undefined symbol: InitDataModelHandler()

referenced by CHIPDeviceControllerFactory.cpp:231 (../../src/controller/CHIPDeviceControllerFactory.cpp:231) libChipController.CHIPDeviceControllerFactory.cpp.o:(chip::Controller::DeviceControllerFactory::InitSystemState(chip::Controller::FactoryInitParams)) in archive lib/libCHIP.a

ld: error: undefined symbol: chip::app::ConcreteAttributePathExists(chip::app::ConcreteAttributePath const&)

referenced by InteractionModelEngine.cpp:488 (../../src/app/InteractionModelEngine.cpp:488) interaction-model.InteractionModelEngine.cpp.o:(chip::app::InteractionModelEngine::ParseAttributePaths(chip::Access::SubjectDescriptor const&, chip::app::AttributePathIBs::Parser&, bool&, unsigned long&)) in archive lib/libCHIP.a

ld: error: undefined symbol: MatterGetAccessPrivilegeForReadAttribute(unsigned int, unsigned int)

referenced by RequiredPrivilege.h:37 (../../src/app/RequiredPrivilege.h:37) interaction-model.InteractionModelEngine.cpp.o:(chip::app::InteractionModelEngine::ParseAttributePaths(chip::Access::SubjectDescriptor const&, chip::app::AttributePathIBs::Parser&, bool&, unsigned long&)) in archive lib/libCHIP.a referenced by RequiredPrivilege.h:37 (../../src/app/RequiredPrivilege.h:37) interaction-model.InteractionModelEngine.cpp.o:(chip::app::InteractionModelEngine::ParseAttributePaths(chip::Access::SubjectDescriptor const&, chip::app::AttributePathIBs::Parser&, bool&, unsigned long&)) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfEndpointCount()

referenced by InteractionModelEngine.cpp:632 (../../src/app/InteractionModelEngine.cpp:632) interaction-model.InteractionModelEngine.cpp.o:(chip::app::InteractionModelEngine::ParseEventPaths(chip::Access::SubjectDescriptor const&, chip::app::EventPathIBs::Parser&, bool&, unsigned long&)) in archive lib/libCHIP.a referenced by AttributePathExpandIterator.cpp:79 (../../src/app/AttributePathExpandIterator.cpp:79) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::PrepareEndpointIndexRange(chip::app::AttributePathParams const&)) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfEndpointIndexIsEnabled(unsigned short)

referenced by InteractionModelEngine.cpp:634 (../../src/app/InteractionModelEngine.cpp:634) interaction-model.InteractionModelEngine.cpp.o:(chip::app::InteractionModelEngine::ParseEventPaths(chip::Access::SubjectDescriptor const&, chip::app::EventPathIBs::Parser&, bool&, unsigned long&)) in archive lib/libCHIP.a referenced by AttributePathExpandIterator.cpp:200 (../../src/app/AttributePathExpandIterator.cpp:200) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::Next()) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfEndpointFromIndex(unsigned short)

referenced by InteractionModelEngine.cpp:639 (../../src/app/InteractionModelEngine.cpp:639) interaction-model.InteractionModelEngine.cpp.o:(chip::app::InteractionModelEngine::ParseEventPaths(chip::Access::SubjectDescriptor const&, chip::app::EventPathIBs::Parser&, bool&, unsigned long&)) in archive lib/libCHIP.a referenced by AttributePathExpandIterator.cpp:206 (../../src/app/AttributePathExpandIterator.cpp:206) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::Next()) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfFindServerCluster(unsigned short, unsigned int)

referenced by InteractionModelEngine.cpp:592 (../../src/app/InteractionModelEngine.cpp:592) interaction-model.InteractionModelEngine.cpp.o:(chip::app::HasValidEventPathForEndpoint(unsigned short, chip::app::EventPathParams const&, chip::Access::SubjectDescriptor const&)) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfFindEndpointType(unsigned short)

referenced by InteractionModelEngine.cpp:572 (../../src/app/InteractionModelEngine.cpp:572) interaction-model.InteractionModelEngine.cpp.o:(chip::app::HasValidEventPathForEndpoint(unsigned short, chip::app::EventPathParams const&, chip::Access::SubjectDescriptor const&)) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfContainsAttribute(unsigned short, unsigned int, unsigned int)

referenced by InteractionModelEngine.cpp:1550 (../../src/app/InteractionModelEngine.cpp:1550) interaction-model.InteractionModelEngine.cpp.o:(chip::app::InteractionModelEngine::RemoveDuplicateConcreteAttributePath(chip::SingleLinkedListNodechip::app::AttributePathParams*&)) in archive lib/libCHIP.a

ld: error: undefined symbol: chip::app::DispatchSingleClusterCommand(chip::app::ConcreteCommandPath const&, chip::TLV::TLVReader&, chip::app::CommandHandler*)

referenced by InteractionModelEngine.cpp:1678 (../../src/app/InteractionModelEngine.cpp:1678) interaction-model.InteractionModelEngine.cpp.o:(chip::app::InteractionModelEngine::DispatchCommand(chip::app::CommandHandler&, chip::app::ConcreteCommandPath const&, chip::TLV::TLVReader&)) in archive lib/libCHIP.a

ld: error: undefined symbol: chip::app::ServerClusterCommandExists(chip::app::ConcreteCommandPath const&)

referenced by InteractionModelEngine.cpp:1683 (../../src/app/InteractionModelEngine.cpp:1683) interaction-model.InteractionModelEngine.cpp.o:(chip::app::InteractionModelEngine::CommandExists(chip::app::ConcreteCommandPath const&)) in archive lib/libCHIP.a referenced by InteractionModelEngine.cpp:1683 (../../src/app/InteractionModelEngine.cpp:1683) interaction-model.InteractionModelEngine.cpp.o:(non-virtual thunk to chip::app::InteractionModelEngine::CommandExists(chip::app::ConcreteCommandPath const&)) in archive lib/libCHIP.a

ld: error: undefined symbol: chip::app::CheckEventSupportStatus(chip::app::ConcreteEventPath const&)

referenced by InteractionModelEngine.cpp:556 (../../src/app/InteractionModelEngine.cpp:556) interaction-model.InteractionModelEngine.cpp.o:(chip::app::HasValidEventPathForEndpointAndCluster(unsigned short, EmberAfCluster const*, chip::app::EventPathParams const&, chip::Access::SubjectDescriptor const&)) in archive lib/libCHIP.a referenced by Engine.cpp:328 (../../src/app/reporting/Engine.cpp:328) interaction-model.Engine.cpp.o:(chip::app::reporting::Engine::CheckAccessDeniedEventPaths(chip::TLV::TLVWriter&, bool&, chip::app::ReadHandler*)) in archive lib/libCHIP.a

ld: error: undefined symbol: MatterGetAccessPrivilegeForReadEvent(unsigned int, unsigned int)

referenced by RequiredPrivilege.h:52 (../../src/app/RequiredPrivilege.h:52) interaction-model.InteractionModelEngine.cpp.o:(chip::app::HasValidEventPathForEndpointAndCluster(unsigned short, EmberAfCluster const*, chip::app::EventPathParams const&, chip::Access::SubjectDescriptor const&)) in archive lib/libCHIP.a referenced by RequiredPrivilege.h:52 (../../src/app/RequiredPrivilege.h:52) libCHIPDataModel.EventManagement.cpp.o:(chip::app::EventManagement::CheckEventContext(chip::app::EventLoadOutContext*, chip::app::EventManagement::EventEnvelopeContext const&)) in archive lib/libCHIP.a referenced by RequiredPrivilege.h:52 (../../src/app/RequiredPrivilege.h:52) interaction-model.Engine.cpp.o:(chip::app::reporting::Engine::CheckAccessDeniedEventPaths(chip::TLV::TLVWriter&, bool&, chip::app::ReadHandler*)) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfGetNthClusterId(unsigned short, unsigned char, bool)

referenced by AttributePathExpandIterator.cpp:220 (../../src/app/AttributePathExpandIterator.cpp:220) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::Next()) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfGetServerAttributeIdByIndex(unsigned short, unsigned int, unsigned short)

referenced by AttributePathExpandIterator.cpp:230 (../../src/app/AttributePathExpandIterator.cpp:230) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::Next()) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfIndexFromEndpoint(unsigned short)

referenced by AttributePathExpandIterator.cpp:83 (../../src/app/AttributePathExpandIterator.cpp:83) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::PrepareEndpointIndexRange(chip::app::AttributePathParams const&)) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfClusterIndex(unsigned short, unsigned int, unsigned char)

referenced by AttributePathExpandIterator.cpp:99 (../../src/app/AttributePathExpandIterator.cpp:99) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::PrepareClusterIndexRange(chip::app::AttributePathParams const&, unsigned short)) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfClusterCount(unsigned short, bool)

referenced by AttributePathExpandIterator.cpp:95 (../../src/app/AttributePathExpandIterator.cpp:95) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::PrepareClusterIndexRange(chip::app::AttributePathParams const&, unsigned short)) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfGetServerAttributeIndexByAttributeId(unsigned short, unsigned int, unsigned int)

referenced by AttributePathExpandIterator.cpp:118 (../../src/app/AttributePathExpandIterator.cpp:118) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::PrepareAttributeIndexRange(chip::app::AttributePathParams const&, unsigned short, unsigned int)) in archive lib/libCHIP.a

ld: error: undefined symbol: emberAfGetServerAttributeCount(unsigned short, unsigned int)

referenced by AttributePathExpandIterator.cpp:112 (../../src/app/AttributePathExpandIterator.cpp:112) libCHIPDataModel.AttributePathExpandIterator.cpp.o:(chip::app::AttributePathExpandIterator::PrepareAttributeIndexRange(chip::app::AttributePathParams const&, unsigned short, unsigned int)) in archive lib/libCHIP.a

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors) clang-12: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

Platform

android

Anything else?

No response

kuyu132 avatar Aug 07 '24 06:08 kuyu132

In the builds of the project homepage, the Android link is 404. Can the Android SDK of this project be compiled normally?

Android no status

kuyu132 avatar Aug 07 '24 06:08 kuyu132

I've never seen anything like this before. What build script did you use to build it?

joonhaengHeo avatar Aug 27 '24 04:08 joonhaengHeo

This may be a custom build. We have updated AttributePathExpandIterator to be split between ember and datamodel provider and the signatures look like that (in #34288). After #36319 the files were joined again.

From what I can tell from the logs, the code behaves as if the CodeGenDataModelProvider is linked in (i.e. it tries to use ember functions such as ConcreteAttributePathExists or emberAfEndpointCount however those are not provided.

Please provide us with information on how to reproduce on master (what command to run to build). I suspect this is some custom code integration that is failing.

andy31415 avatar Nov 25 '24 19:11 andy31415