반응형
안드로이드에서 http 프로토콜로 url 접속을 시도할때
Cleartext HTTP traffic to '' not permitted 와 같은 오류가 발생하는 경우가 있다.
해당 오류는 안드로이드 정책 상 http 프로토콜 접속을 막고 있기 때문에 발생하는 것으로,
http 프로토콜 접속을 허용하는 설정을 아래와 같이 추가해준다.
# http 프로토콜 접속 허용 설정 파일 경로
Android > app > src > main > res > xml > network_security_config.xml
# 설정 추가
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">101.12.34.56</domain>
<domain includeSubdomains="true">102.1.2.3</domain>
<domain includeSubdomains="true">102.4.5.6</domain>
</domain-config>
cleartextTrafficPermitted를 true로 설정해주고
domain-confg에 접속할 ip 주소를 추가해준다.
반응형
'Frontend > React Native' 카테고리의 다른 글
[React Native] 앱 버전 정보 규칙과 앱 버전 정보 조회하기 - 리액트네이티브 (0) | 2023.10.30 |
---|---|
[React Native] 안드로이드 뒤로가기 버튼으로 앱 종료 Toast 메시지 처리 (0) | 2023.10.16 |
[React Native] 리액트 네이티브 비동기 서버 통신 axios 사용법 (0) | 2023.08.23 |
[React Native] 리액트 네이티브 달력 날짜 사용하기 - DateTimePickerModal (0) | 2023.08.14 |
[React Native] 이미지 업로드 하기 - 갤러리, 사진첩 이미지 (0) | 2023.07.31 |
댓글