首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >颤振ObjectBox单元测试-未能加载动态库'lib/objectbox.dll‘

颤振ObjectBox单元测试-未能加载动态库'lib/objectbox.dll‘
EN

Stack Overflow用户
提问于 2021-10-19 12:47:00
回答 1查看 491关注 0票数 0

我正在用objectBox作为DB构建我的新的颤振应用程序。

当我编写包含objectBox的单元测试时,在运行测试时会收到以下错误消息:

加载"C:\Dev\flutter_rebuild\test\db_model_test.dart":无效参数

失败:未能加载动态库'lib/objectbox.dll':126

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-10-19 13:25:12

我在https://opensourcelibs.com/lib/objectbox-dart上找到了这个,它展示了如何将包含"objectbox.dll“的内容下载到Windows中,这样测试就可以在Android中运行。

  1. Dart独立programs:

代码语言:javascript
复制
- Install the packages pub get
- Install objectbox-c system-wide: 
    - macOS/Linux: execute the following command (answer Y when it asks about installing to /usr/lib)

bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)

代码语言:javascript
复制
        - macOS: if dart later complains that it cannot find the libobjectbox.dylib you probably have to unsign the dart binary (source: dart issue):

sudo codesign --remove-signature $(which dart)

代码语言:javascript
复制
    - Windows: use "Git Bash" or similar to execute the following command

bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)

然后将下载的lib/objectbox.dll复制到C:\Windows\System32 32\(需要管理权限)。

ObjectBox为您希望使用build_runner存储的类生成代码绑定代码。在定义了持久化实体(参见下面)之后,运行pub run build_runner buildflutter pub run build_runner build

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69631115

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档