我的 Android 设备中的 RN 应用程序出现问题(尚未在 iOS 上进行测试),一旦我在设备上激活调试,它就会卡在黑屏上。
我不知道代码的哪一部分或什么设置导致了这种情况,这就是我在这里不显示任何代码的原因。只是想看看你们以前是否遇到过同样的问题。
这是我尝试过的:
gradlew clean
react-native start --reset-cache
cleaned app data and cache in the device
uninstalled the app from the device
以下是我迄今为止在我的应用程序上安装和使用的软件包:
{
"name": "bleconnect",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@react-native-async-storage/async-storage": "^1.15.14",
"@react-native-community/blur": "^3.6.0",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-firebase/app": "^14.7.0",
"@react-native-firebase/auth": "^14.2.1",
"@react-native-firebase/firestore": "^12.4.0",
"@react-native-firebase/functions": "^14.2.1",
"@react-native-firebase/storage": "^14.7.0",
"@react-navigation/drawer": "^6.3.1",
"@react-navigation/native": "^6.0.6",
"@react-navigation/stack": "^6.0.11",
"evil-icons": "^1.10.1",
"geofirestore": "^4.4.2",
"haversine": "^1.1.1",
"node": "^16.13.1",
"npm-check-updates": "^12.4.0",
"react": "17.0.1",
"react-chat-elements": "^11.0.1",
"react-content-loader": "^6.2.0",
"react-native": "0.64.2",
"react-native-animated-spinkit": "^1.5.2",
"react-native-countdown-circle-timer": "^3.0.6",
"react-native-device-info": "^8.1.5",
"react-native-elements": "^3.4.2",
"react-native-fast-image": "^8.5.11",
"react-native-gesture-handler": "^2.1.0",
"react-native-grid-image-viewer": "^1.3.0",
"react-native-image-crop-picker": "^0.37.3",
"react-native-image-picker": "^4.7.3",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-location": "^2.5.0",
"react-native-permissions": "^3.3.1",
"react-native-reanimated": "^2.8.0",
"react-native-reanimated-carousel": "^2.4.0",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.2",
"react-native-svg": "^12.3.0",
"react-native-vector-icons": "^8.1.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.64.0",
"react-test-renderer": "17.0.1"
},
"jest": {
"preset": "react-native"
}
}
我会尝试 npm 卸载所有软件包并重新安装最新的软件包,但我正在使用的某些库有特定版本,因此我无法将所有内容更新到最新版本。
最佳答案
我找到了解决方法。我强制将 react-native-reanimated
包降级到 2.2.4,现在调试器工作得很好。
npm i <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a5d7c0c4c6d188cbc4d1ccd3c088d7c0c4cbccc8c4d1c0c1e5978b978b91" rel="noreferrer noopener nofollow">[email protected]</a> --force
如果不使用--force
命令,可能会降级失败。
关于android - 在 React-Native 中激活调试时卡在黑屏上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72382309/