[RN error - Android] Could not connect to development server

stand up_ lee·2022년 9월 5일
0

RN - build error

목록 보기
3/9

빌드까지는 성공했지만, 에뮬레이터 내에서 앱 실행이 되지 않고 에러가 떴다.

Could not connect to development server.
에뮬레이터가 로컬 서버로 접속을 못하고 있는 것 같다.

https://stackoverflow.com/questions/50226232/react-native-emulator-stuck-on-loading-from-localhost8081

위 글을 참고해서

adb reverse --list

adb reverse tcp:8081 tcp:8081

위 코드로 변화가 없으면 아래코드로 직접 지정해준다.
(react-native server는 8081을 사용)

또 어플리케이션에서 localhost 연결 자체가 막히는 경우도 있다고 해서
AndroidManifest.xml에서 http를 허용해주었다.

<application 
	...
	android:usesCleartextTraffic="true"
    >
</application>

https://reactnative.dev/docs/0.61/running-on-device

0개의 댓글