找到NativeScript iOS元数据,但符号在运行时不可用

时间:2019-01-17 08:03:24

标签: ios nativescript libsodium

我正在尝试使用libsodiumhttps://github.com/jedisct1/libsodium)为NativeScript实现自定义插件。我已经下载了源文件并编译为生成libsodium.a和头文件。之后,我将插件插入“ https://docs.nativescript.org/plugins/plugin-reference”之后。它可以正确生成打字稿定义,但是当我尝试在演示应用程序中使用这种情况时:

console.dir(crypto_aead_aes256gcm_abytes())

但是会出现这样的错误:

JavaScript error:
file:///app/main-view-model.js:8:49: JS ERROR ReferenceError: Metadata for "sodium.crypto_aead_aes256gcm_abytes" found but symbol not available at runtime.
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: ReferenceError: Metadata for "sodium.crypto_aead_aes256gcm_abytes" found but symbol not available at runtime.

建筑:

lipo -info sodium.a    
Architectures in the fat file: sodium.a are: i386 armv7 armv7s x86_64 arm64

我在哪里做错了?请给我建议。

1 个答案:

答案 0 :(得分:0)

您的插件是否包含Swift代码?如果是,则需要在插件的xcconfig文件中将EMBEDDED_CONTENT_CONTAINS_SWIFT设置为YES,以加载Swift运行时。