CodenameOne添加Honeywell Captuvo iOS原生库时出现Undefined symbols错误
Hey there! That error pops up because your project isn't linking against the iOS system framework that contains EAAccessoryManager—let's get this sorted out step by step:
1. Understand the Root Cause
The _OBJC_CLASS_$_EAAccessoryManager symbol lives in iOS's ExternalAccessory.framework, a system framework that Codename One doesn't include by default. Your Honeywell Captuvo SDK relies on this framework, so we need to explicitly tell Codename One to link it during the build.
2. Add the Required Framework to Your Codename One Project
Here's how to configure your project to include the ExternalAccessory framework:
- Open your Codename One project's
codenameone_settings.propertiesfile (you'll find this in the project root). - Look for the
ios.additional.frameworksproperty. If it doesn't exist, create it. - Set its value to include
ExternalAccessory. For example:ios.additional.frameworks=ExternalAccessory - If the Captuvo SDK requires other system frameworks (check Honeywell's official docs), add them separated by commas, like:
ios.additional.frameworks=ExternalAccessory,CoreBluetooth
3. Verify Your Library's Architecture (Optional but Safe)
While the error is framework-related, it's good to double-check that your libCaptuvoSDK.a library supports the arm64 architecture:
- On a macOS machine, run this command in the directory where your
.afile is located:lipo -info libCaptuvoSDK.a - Ensure the output includes
arm64—if not, you'll need to get a version of the SDK that supports this architecture.
4. Rebuild Your App
Save the codenameone_settings.properties file, then resubmit your build to Codename One. The linker should now find the EAAccessoryManager class and resolve the undefined symbol error.
内容的提问来源于stack exchange,提问作者NvServices

