ios 类型错误:undefined不是构造函数(正在评估“new Clock()”)

f45qwnt8  于 11个月前  发布在  iOS
关注(0)|答案(1)|浏览(121)

我更新了我的react native项目0.63到0.72.4,并获得了与材料标签相关的问题(“@react-navigation/material-top-tabs”:“^6.6.5”)这个库,因为一切正常,在我添加标签的特定页面上出现错误。
这是我的package.json文件=>

{"name": "Flakex",
  "version": "1.1.0",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@invertase/react-native-apple-authentication": "^2.2.1",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "^1.19.3",
    "@react-native-clipboard/clipboard": "^1.11.1",
    "@react-native-community/blur": "^4.3.2",
    "@react-native-community/cli": "^11.3.8",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/push-notification-ios": "^1.10.1",
    "@react-native-firebase/app": "^18.5.0",
    "@react-native-firebase/auth": "^18.5.0",
    "@react-native-firebase/messaging": "^18.5.0",
    "@react-native-google-signin/google-signin": "^9.0.2",
    "@react-navigation/material-top-tabs": "^6.6.5",
    "@react-navigation/native": "^5.9.3",
    "@react-navigation/stack": "^5.14.3",
    "@stripe/stripe-react-native": "^0.32.0",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "axios": "^0.21.1",
    "firebase": "^10.4.0",
    "jetifier": "^2.0.0",
    "lottie-react-native": "^5.1.6",
    "moment": "^2.29.1",
    "moment-timezone": "^0.5.34",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-native": "^0.72.4",
    "react-native-animatable": "^1.3.3",
    "react-native-awesome-card-io": "^0.9.0",
    "react-native-aws3": "^0.0.9",
    "react-native-calendars": "^1.1301.0",
    "react-native-contacts": "^6.0.5",
    "react-native-countdown-component": "^2.7.1",
    "react-native-country-picker-modal": "^2.0.0",
    "react-native-credit-card-input-view": "^0.0.7",
    "react-native-date-picker": "^3.2.10",
    "react-native-deck-swiper": "^2.0.16",
    "react-native-device-info": "^10.6.0",
    "react-native-eject": "^0.2.0",
    "react-native-fast-image": "8.6.3",
    "react-native-fbsdk-next": "^9.0.0",
    "react-native-geocoder": "^0.5.0",
    "react-native-geolocation-service": "^5.3.1",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-get-random-values": "^1.7.2",
    "react-native-gifted-chat": "^0.16.3",
    "react-native-google-mobile-ads": "^12.2.0",
    "react-native-google-places-autocomplete": "^2.5.1",
    "react-native-image-crop-picker": "^0.40.0",
    "react-native-linear-gradient": "^2.6.2",
    "react-native-localize": "^2.2.2",
    "react-native-location": "^2.5.0",
    "react-native-maps": "^1.7.1",
    "react-native-material-dropdown": "https://github.com/noway/react-native-material-dropdown",
    "react-native-progress-circle": "^2.1.0",
    "react-native-push-notification": "^8.1.1",
    "react-native-ratings": "^8.1.0",
    "react-native-raw-bottom-sheet": "^2.2.0",
    "react-native-reanimated": "^3.5.4",
    "react-native-safe-area-context": "^4.7.2",
    "react-native-screens": "^3.25.0",
    "react-native-snap-carousel": "^1.3.1",
    "react-native-svg": "^12.1.1",
    "react-native-swiper-flatlist": "^3.0.16",
    "react-native-tab-view": "^2.16.0",
    "react-native-webview": "^11.23.1",
    "react-redux": "^7.2.5",
    "redux": "^4.1.1",
    "rn-faded-scrollview": "^1.0.10",
    "uuid": "^8.3.2"
  },
  "devDependencies": {
    "@babel/core": "^7.23.2",
    "@babel/runtime": "^7.23.2",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^29.7.0",
    "eslint": "^7.21.0",
    "jest": "^29.7.0",
    "metro-react-native-babel-preset": "^0.65.2",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

字符串
项目升级后,我用旧版本的材料编译,得到同样的错误,所以我升级了库,在iOS中得到同样的问题。
Here is an image of simulator

sg2wtvxw

sg2wtvxw1#

1.检查兼容性问题查看项目中使用的库的发行说明,特别是@react-navigation/material-top-tabs库,以确保与React Native 0. 72. 4的兼容性。有时,React Native的新版本可能会引入影响某些库功能的破坏性更改。
1.确保所有依赖项,包括@react-navigation/material-top-tabs及其相关包,都更新到与React Native 0.72.4兼容的版本。使用与React Native 0.72.4显式兼容的适当版本。您可能需要检查库的发行说明中提到的任何特定版本或迁移指南。
1.检查弃用的代码在@react-navigation/material-top-tabs库中查找任何弃用的方法或组件,这些方法或组件可能已在较新版本中被替换或删除。
1.清除缓存和重建通过运行npx react-native start --reset-cache来清除React Native缓存:
使用以下命令重新生成项目:

npx react-native run-ios

字符串
或者:

npx react-native run-android

相关问题