NvServices
NvServices

Reputation: 227

CodenameOne "Undefined symbols" error when adding native library

I am trying to add the Honeywell Captuvo iOS library to my CodenameOne project as a native library. I have been through the "Generate Native Access" process and placed the .a library in the native/ios directory. However when I send the app to be built it comes back with the error:

Undefined symbols for architecture arm64:

"_OBJC_CLASS_$_EAAccessoryManager", referenced from: objc-class-ref in libCaptuvoSDK.a(CaptuvoReal.o)

Many thanks

Upvotes: 1

Views: 103

Answers (1)

Shai Almog
Shai Almog

Reputation: 52770

Rereading the error message it seems I missed a key detail. You need to add the ExternalAccessory.framework to your project. To do this you need to define the build hint: ios.add_libs=ExternalAccessory.framework

Original answer below:

Is the name of the .a library preceded with the lower case word lib and does it actually end with a .a. If not make sure to rename it so it abides by these constraints.

Assuming both are OK you will need to verify the library actually has the required architecture in this case arm64.

This is explained in this question: How to check if a static library is built for 64-bit?

I would just use the second suggestion: file libFileName.a

It should include arm64 among the list of supported architectures.

Upvotes: 1

Related Questions