我正在创建一个 React-Native-tvOs 应用程序,在运行该默认模板应用程序时,它显示此错误。我遵循了react-native-tvOs GitHub页面上的所有脚本,但是当我尝试在Xcode Apple TV模拟器上运行它时,它总是会抛出此错误。
这是我正在运行的脚本,来自 GitHub react-native-tvOS 页面:-
npm install -g @react-native-community/cli
react-native init FinalPOC --template=react-native-tvos@latest
cd FinalPOC && react-native run-ios --simulator "Apple TV" --scheme "FinalPOC-tvOS"
我也遇到同样的错误,
使用 rm -rf 删除 node_modules
rm -rf node_modules
那就做
npm install
它对我有用
确保您运行的@react-native-community/cli 版本与您正在运行的react-native 版本兼容。我已经升级到react-native 0.69,但将@react-native-community/cli留在^7.0.0,并收到此错误。当我升级到^8.0.0时解决了。
同样的错误,
修改这个文件
react-native/Libraries/Utilities/createPerformanceLogger.js
也许可以工作。
修改
export const getCurrentTimestamp: () => number =
global.nativeQPLTimestamp ?? global.performance.now.bind(global.performance);
到
export const getCurrentTimestamp: () => number = Date.now
新版本React Native尚未将nativeQPLTimestamp设置为全局变量nativeQPLTimestamp。