Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physics Device not connect metro, but works fine on simulator #47601

Open
yedi97 opened this issue Nov 14, 2024 · 5 comments
Open

Physics Device not connect metro, but works fine on simulator #47601

yedi97 opened this issue Nov 14, 2024 · 5 comments

Comments

@yedi97
Copy link

yedi97 commented Nov 14, 2024

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:

  1. Reset my phone
  2. Unpair and reconnect my phone
  3. reset cache (npm start -- --reset-cache)
  4. run with xcode

Steps to reproduce

  1. connect ios physics device with usb and same wifi
  2. npx react-native run-ios --udid "my Identifier"
  3. my iphone using IOS 18.1, XS model

React Native Version

0.76.1

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 15.1
  CPU: (8) arm64 Apple M1
  Memory: 338.73 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.9.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 4.1.1
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.3
    path: /opt/homebrew/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK:
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11255304
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 18.0.2
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.1.2
    wanted: ^15.1.2
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.1
    wanted: 0.76.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading connected app(s)...

Reproducer

https://github.com/yedi97/reproducer-react-native

Screenshots and Videos

No response

@shubhamguptadream11
Copy link
Collaborator

Did you tried running this using Xcode?

@rizwan-gill
Copy link

rizwan-gill commented Nov 14, 2024

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"
]
}
}
}

@yedi97
Copy link
Author

yedi97 commented Nov 15, 2024

Did you tried running this using Xcode?

Yes, but it still not works

@yedi97
Copy link
Author

yedi97 commented Nov 15, 2024

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}

@Vin-Xi
Copy link
Contributor

Vin-Xi commented Nov 17, 2024

Hi

  1. Try shaking the iOS device and adding your IP Address manually. Check if it works.
  2. If the above doesn't work, then remove watchman (if you have) then try the same as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants