TypeError: 无法读取未定义的属性 ‘Orientation’,JS 引擎:Hermes

huangapple go评论71阅读模式
英文:

using expo-print and getting this error -> TypeError: Cannot read property 'Orientation' of undefined, js engine: hermes

问题

我在我的Expo托管的React Native项目中使用Expo SDK 49。

如果我包含以下导入语句:
enter image description here

然后在运行应用程序时立即出现以下错误:

TypeError: 无法读取未定义的属性 'Orientation',js引擎:hermes

有人遇到过这个问题吗?

尝试升级到Expo SDK 49,也尝试重新安装了Node模块。错误仍然存在。

英文:

Im using expo SDK 49 on my expo managed react-native project.

If I include import statement
enter image description here

Then this error gets immediately thrown when the app is run

TypeError: Cannot read property 'Orientation' of undefined, js engine: hermes

Has anyone faced this issue

Tried upgrading to expo SDK 49, and also tried reinstalling node modules. Error still persists

答案1

得分: 0

找到解决方案,

我当时正在使用 Expo 的开发模式。当使用依赖于原生模块的包时,我必须再次使用 eas build --profile development --platform android 构建该包。

英文:

Found the solution,

I was running on expo dev mode. When using packages that rely on native modules, I have to build the package again with eas build --profile development --platform android

huangapple
  • 本文由 发表于 2023年7月17日 15:31:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76702328.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定