前提
こちらの記事の通り、Docker
を使用してReact native
+ Expo
+ Typescript
の環境構築をしています。
実現したいこと
$ docker-compose up
を実行して、表示されたQRコードを読み取り、iPhoneで実機テストを行いたいです。
発生している問題・エラーメッセージ
iPhoneのExpo Go
の画面には
Expo_Go
1There was a problem loading the requested app. 2 3It looks like you may be using a LAN URL. 4Make sure your device is on the same network as the server, and that you have granted Expo Go the Local Network permission in the Settings app, or try using the tunnel connection type. 5 6Try again 7Go back to Expo Home 8exp://192.168.0.2:19000 9 10The request timed out.
と表示されています。
該当のソースコード
App/react_native/Dockerfile
1FROM node:14-alpine 2 3WORKDIR /usr/src/app/ 4 5RUN apk update && apk add bash 6 7RUN yarn global add expo-cli
App/docker_compose.yml
1version: "3" 2services: 3 react_native: 4 build: ./docker/react_native 5 volumes: 6 - ./react_native/:/usr/src/app 7 env_file: .env 8 command: yarn start 9 ports: 10 - "19000:19000" 11 - "19001:19001" 12 - "19002:19002"
App/.env
1REACT_NATIVE_PACKAGER_HOSTNAME=192.168.0.2
調べてみましたが、あまりよく分かりませんでした。
ご教示いただけますと幸いです、よろしくお願いします。
あなたの回答
tips
プレビュー