我意识到这已经被问过很多次(github、stackoverflow、expo.io),通常有一个解决方案,但是我已经尝试了所有这些,所以我认为我的情况可能会有所不同。
我已经开发(甚至以某种方式发布)了一个使用 Expo 的本地反应应用程序。今天早上,我将 Expo SDK 从版本 40 更新到 41。iOS 没有问题,仅在 android(模拟器和真实设备)上。
我认为问题在于 react-native-router-flux 指的是 react-native-reanimation 的较旧依赖项。SDK 41 需要 v2.2.0 而 react-native-router-flux 只需要 v1.13.3
我到目前为止:
- 删除 package-lock.json 的内容并运行
npm install
。 - 删除了基本导航依赖项和 react-native-router-flux 并使用重新安装
expo install
(我读到这比在 Expo 托管项目上使用 npm install 更好。) - 将 Babel 插件添加到 babel.config.js - plugins: ['react-native-reanimated/plugin']
- 重置缓存并运行
watchman watch-del-all
- 来回更改本机反应的版本无济于事。
- 今天大部分时间都在试图解决这个问题。
我没有但想尝试:
- 要更新 RN 路由器通量对 RN 的依赖,重新激活以使用最新和已安装的版本(但我不确定如何)。根据此评论,我“处于困难时期”。
我不想:
- 恢复到 SDK 40,因为我需要针对位置的模块特定权限方法,因为 Google Play 已经从商店中删除了我的应用程序以解决权限问题(这么多箍!)
有关更多详细信息,请参见下文 - 如果您需要任何其他信息,请告诉我。
展会诊断:
Expo CLI 4.7.1 environment info:
System:
OS: macOS 11.2.3
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.1 - /usr/local/bin/node
npm: 7.14.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
API Levels: 29
Build Tools: 29.0.3
System Images: android-29 | Google APIs Intel x86 Atom, android-R | Google Play Intel x86 Atom
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7042882
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
npmPackages:
expo: ^41.0.0 => 41.0.1
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: ^0.63.4 => 0.63.4
react-native-web: ~0.13.12 => 0.13.18
npmGlobalPackages:
expo-cli: 4.7.1
Expo Workflow: managed
package.json(RN 复活现在说 v~2.1.0 但在我再次使用它之前它是 2.2.0。
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@react-native-community/datetimepicker": "^3.5.2",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/netinfo": "6.0.0",
"@react-native-picker/picker": "1.9.11",
"expo": "^41.0.0",
"expo-av": "~9.1.2",
"expo-location": "~12.0.4",
"expo-updates": "~0.5.4",
"firebase": "8.2.3",
"html-entities": "^1.3.1",
"moment": "^2.24.0",
"nanoid": "^3.1.22",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "^0.63.4",
"react-native-datepicker": "^1.7.2",
"react-native-form-validator": "^0.3.2",
"react-native-gesture-handler": "~1.10.2",
"react-native-get-random-values": "~1.7.0",
"react-native-maps": "0.27.1",
"react-native-message-dialog": "^1.0.1",
"react-native-modal": "^11.10.0",
"react-native-modal-datetime-picker": "^7.6.1",
"react-native-numeric-input": "^1.8.3",
"react-native-responsive-screen": "^1.4.0",
"react-native-router-flux": "^4.3.1",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "~3.0.0",
"react-native-snap-carousel": "^3.8.4",
"react-native-uuid-generator": "^6.1.1",
"react-native-video": "^5.0.2",
"react-native-web": "~0.13.12",
"react-redux": "^7.1.1",
"redux": "^4.0.4",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"react-native-reanimated": "~2.1.0"
},
"devDependencies": {
"babel-preset-expo": "8.3.0",
"redux-logger": "^3.0.6"
},
"private": true
}
package-lock.json (我可以包含所有这些,但它是 23k 行,所以我刚刚包含了 RN 重新激活的引用。)
{
"name": "bumblr",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"@react-native-community/datetimepicker": "^3.5.2",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/netinfo": "6.0.0",
"@react-native-picker/picker": "1.9.11",
"expo": "^41.0.0",
"expo-av": "~9.1.2",
"expo-location": "~12.0.4",
"expo-updates": "~0.5.4",
"firebase": "8.2.3",
"html-entities": "^1.3.1",
"moment": "^2.24.0",
"nanoid": "^3.1.22",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "^0.63.4",
"react-native-datepicker": "^1.7.2",
"react-native-form-validator": "^0.3.2",
"react-native-gesture-handler": "~1.10.2",
"react-native-get-random-values": "~1.7.0",
"react-native-maps": "0.27.1",
"react-native-message-dialog": "^1.0.1",
"react-native-modal": "^11.10.0",
"react-native-modal-datetime-picker": "^7.6.1",
"react-native-numeric-input": "^1.8.3",
"react-native-reanimated": "~2.1.0",
...
"node_modules/react-native-reanimated": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.1.0.tgz",
"integrity": "sha512-tlPvvcdf+X7HGQ7g/7npBFhwMznfdk7MHUc9gUB/kp2abSscXNe/kOVKlrNEOO4DS11rNOXc+llFxVFMuNk0zA==",
"dependencies": {
"@babel/plugin-transform-object-assign": "^7.10.4",
"fbjs": "^3.0.0",
"mockdate": "^3.0.2",
"string-hash-64": "^1.0.3"
},
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-gesture-handler": "*"
}
},
...
"node_modules/react-native-router-flux/node_modules/react-native-reanimated": {
"version": "1.13.3",
"resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-1.13.3.tgz",
"integrity": "sha512-i714H24dv6ncpFO7/SZ0PfAMbvjgVbF8Ow2NPtowoZAz8osS54DmTMrkgJ9Za+uEku/s0AEaxqiXG2Xgntvv2g==",
"peer": true,
"dependencies": {
"fbjs": "^1.0.0"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
}
},
...
"node_modules/react-native-router-flux/node_modules/react-navigation-drawer": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-2.7.1.tgz",
"integrity": "sha512-W36XDl+Ts5uGNr6Ryt1xGrQ5JTeddPmvR31bNX7o6Oo7OsdPZ3b1+oMDoRClGca0d6Ggo7btIqiWUsUshm+p/g==",
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-gesture-handler": "^1.0.12",
"react-native-reanimated": "^1.0.0",
"react-native-screens": ">=1.0.0 || >= 2.0.0-alpha.0 || >= 2.0.0-beta.0 || >= 2.0.0",
"react-navigation": "^4.1.1"
}
},
...
"node_modules/react-native-router-flux/node_modules/react-navigation-tabs": {
"version": "2.11.1",
"resolved": "https://registry.npmjs.org/react-navigation-tabs/-/react-navigation-tabs-2.11.1.tgz",
"integrity": "sha512-wq2wR3awu6PKimmVOycBf+iTPA9FWThbJwcaDBQEhQiiviXQzAtT3lw3nV9oqNIg4v65tdPhL1Dg8ptTJ03NjQ==",
"dependencies": {
"hoist-non-react-statics": "^3.3.2",
"react-lifecycles-compat": "^3.0.4",
"react-native-iphone-x-helper": "^1.3.0",
"react-native-tab-view": "^2.15.2"
},
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-gesture-handler": "^1.0.0",
"react-native-reanimated": "^1.0.0-alpha",
"react-native-screens": ">=1.0.0 || >= 2.0.0-alpha.0 || >= 2.0.0-beta.0 || >= 2.0.0",
"react-navigation": "^4.1.1"
}
},
...
"node_modules/react-native-tab-view": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-2.16.0.tgz",
"integrity": "sha512-ac2DmT7+l13wzIFqtbfXn4wwfgtPoKzWjjZyrK1t+T8sdemuUvD4zIt+UImg03fu3s3VD8Wh/fBrIdcqQyZJWg==",
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-gesture-handler": "*",
"react-native-reanimated": "*"
}
},
...
"react-native-reanimated": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.1.0.tgz",
"integrity": "sha512-tlPvvcdf+X7HGQ7g/7npBFhwMznfdk7MHUc9gUB/kp2abSscXNe/kOVKlrNEOO4DS11rNOXc+llFxVFMuNk0zA==",
"requires": {
"@babel/plugin-transform-object-assign": "^7.10.4",
"fbjs": "^3.0.0",
"mockdate": "^3.0.2",
"string-hash-64": "^1.0.3"
},
"dependencies": {
"fbjs": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/fbjs/-/fbjs-3.0.0.tgz",
"integrity": "sha512-dJd4PiDOFuhe7vk4F80Mba83Vr2QuK86FoxtgPmzBqEJahncp+13YCmfoa53KHCo6OnlXLG7eeMWPfB5CrpVKg==",
"requires": {
"cross-fetch": "^3.0.4",
"fbjs-css-vars": "^1.0.0",
"loose-envify": "^1.0.0",
"object-assign": "^4.1.0",
"promise": "^7.1.1",
"setimmediate": "^1.0.5",
"ua-parser-js": "^0.7.18"
}
}
}
},
...
"react-native-router-flux": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/react-native-router-flux/-/react-native-router-flux-4.3.1.tgz",
"integrity": "sha512-WeNgkHvRGIUz/AlfdSiTAjctgbIzC9oyPJ4yvGKxuM0qohltDjdB4a02vlNSjve7NS+5aSQMEWZAfINgnZGg+w==",
"requires": {
"@babel/runtime": "^7.6.0",
"add": "^2.0.6",
"lodash": "^4.17.15",
"opencollective": "^1.0.3",
"path-to-regexp": "^2.4.0",
"prop-types": "^15.6.2",
"react-navigation": "^4.x",
"react-navigation-drawer": "^2.2.1",
"react-navigation-stack": "^2.10.2",
"react-navigation-tabs": "^2.10.1",
"remove": "^0.1.5"
},
"dependencies": {
"core-js": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
"peer": true
},
"fbjs": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fbjs/-/fbjs-1.0.0.tgz",
"integrity": "sha512-MUgcMEJaFhCaF1QtWGnmq9ZDRAzECTCRAF7O6UZIlAlkTs1SasiX9aP0Iw7wfD2mJ7wDTNfg2w7u5fSCwJk1OA==",
"peer": true,
"requires": {
"core-js": "^2.4.1",
"fbjs-css-vars": "^1.0.0",
"isomorphic-fetch": "^2.1.1",
"loose-envify": "^1.0.0",
"object-assign": "^4.1.0",
"promise": "^7.1.1",
"setimmediate": "^1.0.5",
"ua-parser-js": "^0.7.18"
}
},
"react-native-reanimated": {
"version": "1.13.3",
"resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-1.13.3.tgz",
"integrity": "sha512-i714H24dv6ncpFO7/SZ0PfAMbvjgVbF8Ow2NPtowoZAz8osS54DmTMrkgJ9Za+uEku/s0AEaxqiXG2Xgntvv2g==",
"peer": true,
"requires": {
"fbjs": "^1.0.0"
}
},
"react-navigation-drawer": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-2.7.1.tgz",
"integrity": "sha512-W36XDl+Ts5uGNr6Ryt1xGrQ5JTeddPmvR31bNX7o6Oo7OsdPZ3b1+oMDoRClGca0d6Ggo7btIqiWUsUshm+p/g==",
"requires": {}
},
"react-navigation-tabs": {
"version": "2.11.1",
"resolved": "https://registry.npmjs.org/react-navigation-tabs/-/react-navigation-tabs-2.11.1.tgz",
"integrity": "sha512-wq2wR3awu6PKimmVOycBf+iTPA9FWThbJwcaDBQEhQiiviXQzAtT3lw3nV9oqNIg4v65tdPhL1Dg8ptTJ03NjQ==",
"requires": {
"hoist-non-react-statics": "^3.3.2",
"react-lifecycles-compat": "^3.0.4",
"react-native-iphone-x-helper": "^1.3.0",
"react-native-tab-view": "^2.15.2"
}
}
}
},
...