1
0

React nativeでExpo使用時にCould not connect to development server.

Posted at

事象

ExpoGoいれていざシミュレーターでビルドしようとしたら出るエラー。

URL: http://192.168.~~~:8081/src/main.ts.bundle?
platform=ios&dev=true&hot=false&transform.engine=hermes&transform.bytecode=tr ue&transform.routerRoot=app

こいつにアクセスできないとかでエラーが出てるがそんなファイルは存在しない。シミュレーターのsafariで対象の192.168を入力したところアクセスできるのでネットワーク関連の線は薄い。

StackOverFlowではnpm installで解決したやらキャッシュがどうのこうのwatchmanの削除で動くようになったやら色々あった。

が、いずれも解決せず。

解決法

/Users/user名/Library/LaunchAgentsのアクセス権を変更する

chmod 777 /Users/user名/Library/LaunchAgents

予想

どうやらwatchmanはファイルの変更を検知するためのものらしい。
そこでビルド時に先ほどのフォルダに自動でplistを作成する。
が、アクセス権が無いので弾かれてしまい監視対象のファイルが検知できなくなったのではと推測

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0