안드로이드/Error
에러: ERR_CLEARTEXT_NOT_PERMITTED
devGeek
2022. 5. 4. 06:00
반응형
에러: ERR_CLEARTEXT_NOT_PERMITTED
원인
웹뷰가 실행되었지만, ERR_CLEARTEXT_NOT_PERMITTED
와 같은 에러가 발생할 때가 있다. 그 이유는 URL을 통해서 웹 페이지를 로드하는데 https
가 아닌 http
프로토콜을 사용하여 보안이 취약하기 때문이다.
해결방법
이를 해결하기 위해서는 AndroidManifest.xml
파일에서 application
태그 속성으로 android:usesCleartextTraffic="true"
를 추가해야 한다.
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.SearchDeliveryInfoApplication"
android:usesCleartextTraffic="true">
반응형