Open yedi97 opened 1 week ago
Did you tried running this using Xcode?
I'm facing the same issue on the Android real device. it works on the simulator. Also using the expo in bare.
metro.config.js
const path = require('path') const { getDefaultConfig } = require('expo/metro-config') module.exports = (() => { const config = getDefaultConfig(__dirname)
const { transformer, resolver } = config
config.transformer = {
...transformer,
babelTransformerPath: require.resolve('react-native-svg-transformer/expo'),
}
config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter((ext) => ext !== 'svg').filter((ext) => ext !== 'db'), // add to filter db file in assets
sourceExts: [...resolver.sourceExts, 'svg'],
}
console.log('====> ', __dirname)
config.watchFolders = [
path.resolve(__dirname),
path.resolve(__dirname, './node_modules'),
path.resolve(__dirname, '../../packages'),
path.resolve(__dirname, '../../node_modules'),
]
config.resetCache = true
return config
})()
package.json
"dependencies": { "@emotion/native": "^11.11.0", "@emotion/react": "^11.13.3", "@expo/config-plugins": "~9.0.0", "@expo/metro-config": "^0.19.4", "@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/datetimepicker": "8.2.0", "@react-native-community/masked-view": "^0.1.11", "@react-native-community/netinfo": "11.4.1", "@react-native-firebase/app": "^21.2.0", "@react-native-firebase/messaging": "^21.2.0", "@react-native/js-polyfills": "^0.76.1", "@react-navigation/bottom-tabs": "^6.6.1", "@react-navigation/material-top-tabs": "^6.6.14", "@react-navigation/native": "^6.1.18", "@react-navigation/native-stack": "^6.11.0", "@react-navigation/stack": "^6.4.1", "@types/react-native-auth0": "^2.17.9", "@types/react-native-video": "^5.0.20", "axios": "^1.7.7", "base64-arraybuffer": "^1.0.2", "buffer": "^6.0.3", "eslint-plugin-import": "^2.31.0", "eslint-plugin-unused-imports": "^4.1.4", "expo": "^52.0.6", "expo-file-system": "~18.0.0", "expo-image-picker": "~16.0.1", "expo-media-library": "~17.0.2", "ffmpeg-kit-react-native": "^6.0.2", "lodash": "^4.17.21", "luxon": "^3.5.0", "metro": "^0.81.0", "metro-config": "^0.81.0", "metro-runtime": "^0.81.0", "react": "18.3.1", "react-dom": "^18.3.1", "react-i18next": "^15.1.0", "react-native": "0.76.1", "react-native-auth0": "^3.2.1", "react-native-bootsplash": "^6.2.6", "react-native-devsettings": "^1.0.5", "react-native-dotenv": "^3.4.11", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "~2.20.2", "react-native-gifted-charts": "^1.4.47", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-linear-gradient": "^2.8.3", "react-native-mask-input": "^1.2.3", "react-native-modal-datetime-picker": "^18.0.0", "react-native-pager-view": "6.4.1", "react-native-paper": "^5.12.5", "react-native-reanimated": "~3.16.1", "react-native-render-html": "^6.3.4", "react-native-safe-area-context": "4.12.0", "react-native-screens": "^4.0.0", "react-native-subtitles": "^5.0.5", "react-native-svg": "15.8.0", "react-native-svg-transformer": "^1.5.0", "react-native-tab-view": "^3.5.2", "react-native-video": "^6.7.0", "react-native-videoeditorsdk": "^3.2.0", "react-native-webview": "13.12.2", "rn-fetch-blob": "^0.12.0" }, "devDependencies": { "@babel/core": "^7.25.2", "@babel/preset-env": "^7.25.3", "@babel/runtime": "^7.25.0", "@react-native-community/cli": "15.0.0", "@react-native-community/cli-platform-android": "15.0.0", "@react-native-community/cli-platform-ios": "15.0.0", "@react-native/babel-preset": "0.76.1", "@react-native/eslint-config": "0.76.1", "@react-native/metro-babel-transformer": "^0.76.1", "@react-native/metro-config": "0.76.1", "@react-native/typescript-config": "0.76.1", "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "babel-plugin-module-resolver": "^5.0.2", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.3.1", "typescript": "~5.3.3" }, "engines": { "node": ">=18" }, "expo": { "autolinking": { "exclude": [ "expo-font" ], "ios": { "exclude": [ "expo-keep-awake" ] } } }
Did you tried running this using Xcode?
Yes, but it still not works
In xcode logs:
Task <46652AA0-3A92-403F-ABC5-56427FC8E409>.<2> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009
"The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x303b4bb10
{Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)"
UserInfo={_NSURLErrorNWPathKey=unsatisfied (Local network prohibited), interface: en0[802.11], ipv4, ipv6, uses wifi, _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <46652AA0-3A92-403F-ABC5-56427FC8E409>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <46652AA0-3A92-403F-ABC5-56427FC8E409>.<2>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=http://192.168.5.9:8081/status, NSErrorFailingURLKey=http://192.168.5.9:8081/status, _kCFStreamErrorDomainKey=1}
Hi
Hi
- Try shaking the iOS device and adding your IP Address manually. Check if it works.
- If the above doesn't work, then remove watchman (if you have) then try the same as above.
I tried both methods above before, but it still doesn't work
Description
It works fine on simulator but with physics device it cannot connect. Sure i'm using the same wifi network, tried many ways like:
Steps to reproduce
React Native Version
0.76.1
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/yedi97/reproducer-react-native
Screenshots and Videos
No response