FaridSafi / react-native-gifted-chat

💬 The most complete chat UI for React Native
https://gifted.chat
MIT License
13.5k stars 3.55k forks source link

Android build failed, Unable to resolve module react-native-get-random-values #2547

Closed musabgulfam closed 3 days ago

musabgulfam commented 4 days ago

Issue Description

I have been facing error when I am issuing react-native run android command, the following error pops up.

`Error: Unable to resolve module react-native-get-random-values from /Users/musabgulfam/Cannabis/node_modules/react-native-gifted-chat/lib/index.js: react-native-get-random-values could not be found within the project or in these directories: node_modules/react-native-gifted-chat/node_modules node_modules

1 | import 'react-native-get-random-values'; // NOTE: FOR "uuid" SUPPORT | ^ 2 | export from './GiftedChat'; 3 | export from './Constant'; 4 | export * from './utils'; `

Steps to Reproduce / Code Snippets

It can be reproduced by just issuing react-native run android

Expected Results

Build successful

Additional Information

*my dependencies "dependencies": { "@invertase/react-native-apple-authentication": "^2.2.2", "@notifee/react-native": "^5.6.0", "@react-native-async-storage/async-storage": "^1.17.0", "@react-native-community/clipboard": "^1.5.1", "@react-native-community/datetimepicker": "^6.1.2", "@react-native-community/geolocation": "^2.0.2", "@react-native-community/push-notification-ios": "^1.10.1", "@react-native-community/slider": "^4.2.1", "@react-native-firebase/app": "^19.2.2", "@react-native-firebase/auth": "^19.2.2", "@react-native-firebase/dynamic-links": "^19.2.2", "@react-native-firebase/messaging": "^19.2.2", "@react-native-firebase/storage": "^19.2.2", "@react-native-google-signin/google-signin": "^9.1.0", "@react-native-picker/picker": "^2.4.0", "@react-navigation/bottom-tabs": "^6.2.0", "@react-navigation/drawer": "^6.6.6", "@react-navigation/native": "^6.0.8", "@react-navigation/native-stack": "^6.5.2", "@twotalltotems/react-native-otp-input": "^1.3.11", "apisauce": "^2.1.2", "axios": "^0.26.1", "deprecated-react-native-prop-types": "^5.0.0", "easy-peasy": "^5.0.4", "geolib": "^3.3.3", "joi": "^17.4.2", "lodash": "^4.17.21", "moment": "^2.29.2", "query-string": "^8.1.0", "react": "18.2.0", "react-native": "0.72.7", "react-native-branch": "^6.2.2", "react-native-calendars": "^1.1305.0", "react-native-camera": "^4.2.1", "react-native-config": "^1.5.1", "react-native-countdown-component": "^2.7.1", "react-native-countdown-fixed": "^2.7.1", "react-native-date-picker": "^5.0.4", "react-native-device-info": "^10.6.0", "react-native-exit-app": "^2.0.0", "react-native-fbsdk-next": "^12.1.1", "react-native-gesture-handler": "^2.14.1", "react-native-gifted-chat": "^2.4.0", "react-native-google-places-autocomplete": "^2.5.6", "react-native-image-crop-picker": "^0.40.2", "react-native-image-picker": "^4.7.3", "react-native-linear-gradient": "^2.5.6", "react-native-maps": "^1.8.0", "react-native-maps-directions": "^1.9.0", "react-native-modal": "^13.0.0", "react-native-modal-datetime-picker": "^14.0.0", "react-native-modal-selector": "^2.1.2", "react-native-network-info": "^5.2.1", "react-native-paper": "^4.9.2", "react-native-permissions": "^3.10.1", "react-native-public-ip": "^1.0.2", "react-native-qrcode-scanner": "^1.5.5", "react-native-radial-gradient": "^1.1.2", "react-native-raw-bottom-sheet": "^2.2.0", "react-native-reanimated": "^3.6.1", "react-native-render-html": "^6.3.4", "react-native-restart": "0.0.22", "react-native-safe-area-context": "^4.2.4", "react-native-screens": "^3.13.1", "react-native-share": "^10.2.0", "react-native-simple-toast": "^1.1.3", "react-native-snap-carousel": "^3.9.1", "react-native-splash-screen": "^3.3.0", "react-native-svg": "^12.1.1", "react-native-svg-transformer": "^0.14.3", "react-native-toast-message": "^2.1.3", "react-native-vector-icons": "^10.0.2", "react-native-version-info": "^1.1.1", "react-native-webview": "^11.18.2", "socket.io-client": "^4.5.2" }, "resolutions": { "react-native-permissions": "^3.10.1" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.24.7", "@react-native/eslint-config": "^0.72.2", "@react-native/metro-config": "^0.72.11", "@tsconfig/react-native": "^3.0.0", "@types/react": "^18.0.24", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.2.1", "babel-plugin-transform-remove-console": "^6.9.4", "eslint": "^8.19.0", "jest": "^29.2.1", "metro-react-native-babel-preset": "0.76.8", "prettier": "^2.4.1", "react-test-renderer": "18.2.0", "typescript": "4.8.4" }

Utsav610 commented 3 days ago

Same issue +1

musabgulfam commented 3 days ago

yarn add react-native-gifted-chat react-native-reanimated react-native-safe-area-context react-native-get-random-values

Use this command, I found this in the docs 😅