1.manifest에 추가
- <application android:networkSecurityConfig="@xml/network_security_config" ...>
- <manifest android:targetSandboxVersion="1" xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dallygram">
- <uses-permission android:name="android.permission.INTERNET" />
2.res/xml/network_security_config.xml 파일 생성 후 코드 작성
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
참고 블로그
https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted
Android 8: Cleartext HTTP traffic not permitted
I had reports from users with Android 8 that my app (that uses back-end feed) does not show content. After investigation I found following Exception happening on Android 8: 08-29 12:03:11.246 11285-
stackoverflow.com
https://developside.tistory.com/85
안드로이드 http 프로토콜 접속 시 예외발생 조치 (ERR CLEARTEXT NOT PERMITTED)
어제 앱을 개발 중 glide v4를 사용하여 웹에 있는 그림을 load 하였는데, 아래와 같은 예외를 주며 동작을 하지 않았습니다. com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java...
developside.tistory.com
'내맘대로 > 안드로이드' 카테고리의 다른 글
[Android] Volley (0) | 2021.02.17 |
---|---|
이미지 Uri -> String (0) | 2019.10.09 |
갤러리에서 여러 이미지 선택 (0) | 2019.10.03 |
Acitivity로 이미지 Uri 받아오기 (0) | 2019.10.03 |
갤러리에서 사진 가져오기 (Uri) (0) | 2019.10.03 |