부귀영화
Could not connect to development server 본문
📌 Error Message
✅ How to Solve
<app-src>/android/app/src/debug/res/xml/react_native_config.xml
에서 아래와 같이 코드를 추가한다. (없으면 새로 생성)
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
<domain includeSubdomains="false">YOUR IP ADDRESS</domain>
</domain-config>
</network-security-config>
그리고 clean한 다음에 rebuild 한다.
cd android
./gradlew clean
cd ..
react-native run-android
마지막으로 안드로이드 에뮬레이터의 Change Bundle Location에서 localhost:8081 입력한다.
'개발 > React Native' 카테고리의 다른 글
React Navgation navigate with object params (0) | 2022.03.08 |
---|---|
[!] Invalid Podfile file: 767: unexpected token at '. 해결법 (0) | 2022.01.29 |