未找到原生 ExponentConstants 模块,您确定 expo-constants 模块已正确链接吗?

问题描述 投票:0回答:4

当我运行我的博览会/玩笑项目时,我收到这些警告,我不知道为什么,在谷歌搜索时似乎没有出现。

console.warn
    The "EXNativeModulesProxy" native module is not exported through NativeModules; verify that expo-modules-core's native code is linked properly

      at Object.<anonymous> (node_modules/expo-modules-core/src/NativeModulesProxy.native.ts:54:11)
      at Object.<anonymous> (node_modules/expo-modules-core/src/index.ts:4:1)

  console.warn
    No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?

      at Object.<anonymous> (node_modules/expo-constants/src/Constants.ts:32:11)
      at Object.<anonymous> (node_modules/expo-asset/src/PlatformUtils.ts:2:1)
jestjs expo
4个回答
5
投票

我在测试(玩笑)中遇到了这个错误,我必须在玩笑配置中安装

jest-expo
并更改
preset
来模拟玩笑的博览会内容并修复此问题。

请参阅此处的详细信息:https://docs.expo.dev/guides/testing-with-jest/#installation


1
投票

如果您在项目中使用任何 Expo 库,您需要的重要一点是 package.json 文件中的 expoexpo-core-modules 包。

例如就我而言:

"expo": "^48.0.0",
"expo-modules-core": "^1.2.3"

如果 package.json 不包含这些包,请安装它们:

npm install expo expo-modules-core

0
投票

这可以帮助解决所有与世博会相关的警告和错误 在本机反应中(裸/安装-expo-modules):0.73.5 npm 我 [电子邮件受保护] 链接手动点击此链接==> https://docs.expo.dev/bare/installing-expo-modules/#using-expo-sdk-packages 安装后==>npm i expo-modules-core (版本: "expo-modules-core": "~1.11.10",) 如果您使用此包,则版本必须遵循=>expon-constant(version:15.4.5), 展览文件系统(版本:16.0.8), 世博字体(版本:11.10.3), expo-keep-awake(版本:12.8.2)等


-1
投票

遇到了 iOS 构建的一些问题,然后通过修复 expo_patch_react_imports

Profile.lock
的错误位置来
解决了
。查看正确的位置那里(世博文档)

© www.soinside.com 2019 - 2024. All rights reserved.