ivopr / tamagui-expo

An Expo template with Tamagui
270 stars 22 forks source link

My App cannot connected when running expo start --dev-client #22

Closed AchrafBn closed 1 year ago

AchrafBn commented 1 year ago

Hi, I am building my app on a physical device using Xcode. After, the launcher screen appeared. Then, I ran the command 'npx expo start --dev-client'. After scanning the QR code, Safari opened with the message 'Safari cannot open the page because it could not connect to the server' with this URL: http://localhost:8081. (Metro waiting on http://localhost:8081)

When I hit 'r' to reload, it says 'warn: 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.',but It works fine on the iOS simulator My computer and device are connected to the same Wi-Fi.

Any help to fix it please ?

Package versions

"@expo-google-fonts/baskervville": "^0.2.3",
    "@expo-google-fonts/mulish": "^0.2.3",
    "@kanelloc/react-native-animated-header-scroll-view": "^0.12.0",
    "@react-navigation/drawer": "^6.6.2",
    "@react-navigation/native": "6.1.1",
    "@react-navigation/native-stack": "6.9.7",
    "@tamagui/animations-reanimated": "1.5.19",
    "@tamagui/font-inter": "1.5.19",
    "@tamagui/lucide-icons": "1.5.19",
    "@tamagui/shorthands": "1.5.19",
    "@tamagui/theme-base": "1.5.19",
    "add": "^2.0.6",
    "expo": "~47.0.12",
    "expo-av": "~13.0.3",
    "expo-dev-client": "2.1.6",
    "expo-font": "11.0.1",
    "expo-linear-gradient": "12.0.1",
    "expo-speech": "~11.0.0",
    "expo-splash-screen": "~0.17.5",
    "expo-status-bar": "~1.4.2",
    "expo-updates": "~0.15.6",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-native": "0.70.5",
    "react-native-gesture-handler": "2.9.0",
    "react-native-lightbox-v2": "^0.9.0",
    "react-native-reanimated": "2.14.4",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "3.18.2",
    "react-native-shadow-2": "^7.0.6",
    "react-native-svg": "13.4.0",
    "react-native-timeline-flatlist": "^0.8.0",
    "react-native-web": "0.18.10",
    "tamagui": "1.5.19",
    "yarn": "^1.22.19"

Environment

 System:
      OS: macOS 12.5.1
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 19.8.1 - /opt/homebrew/bin/node
      Yarn: 3.2.0 - ~/Documents/dev/maison-des-geants/node_modules/.bin/yarn
      npm: 8.19.4 - ~/Documents/dev/maison-des-geants/node_modules/.bin/npm
    Managers:
      CocoaPods: 1.12.0 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    IDEs:
      Android Studio: 2022.1 AI-221.6008.13.2211.9619390
      Xcode: 14.2/14C18 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~47.0.12 => 47.0.13 
      react: 18.1.0 => 18.1.0 
      react-dom: 18.1.0 => 18.1.0 
      react-native: 0.70.5 => 0.70.5 
      react-native-web: 0.18.10 => 0.18.10 
    Expo Workflow: bare
ivopr commented 1 year ago

@AchrafBn thanks for reaching out. As far as I remember --dev-client is not needed anymore, also, from the looks of it, the QR is telling your browser to open localhost:8081 instead of yourmachineip:19000 or with any other port expo uses. I am unable to say that it is caused by the bare workflow as I myself don't use it, as dev-client solved all my necessities. What I can think of is to run yarn start which should do yarn expo start under the hood, if it doesn't, normally when you start the server, it logs to your terminal at which IP address and port it is linked to (e.g.: 192.168.1.112:19001 and so on), you should try typing this link manually in your browser to see what happens. If both of these doesn't work, I'm seriously unable to help you further, as I've never developed anything for/on a apple device and don't know how it works in there.

AchrafBn commented 1 year ago

@ivopr yarn expo start it works ,I was running the wrong command. Thanks