error: RN | android localhost error

Lumpen·2023년 2월 24일
0

Error

목록 보기
40/41

android 에서 http://localhost 에 접속하려면
2가지 문제가 있다

  1. http 통신 설정
  2. localhost ip 설정

http 통신 설정

AndroidManifest.xml 의 application 태그에
android:usesCleartextTraffic="true"
속성을 주면 된다
main/AndroidManifest.xml 이면 에뮬레이터
development/AndroidManifest.xml 이면 빌드 파일 설정임

localhost ip 주소 설정

android 에서 10.0.2.2 로 설정하면 127.0.0.1(localhost) 로 설정된다

profile
떠돌이 생활을 하는. 실업자는 아니지만, 부랑 생활을 하는

0개의 댓글