「Android/開発環境/Android8」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→java.io.IOException: Cleartext HTTP traffic to example.com not permittedエラーが出る) |
(→java.io.IOException: Cleartext HTTP traffic to example.com not permittedエラーが出る) |
||
行13: | 行13: | ||
AndroidManifest.xml | AndroidManifest.xml | ||
<application | <application | ||
− | android:networkSecurityConfig="@xml/network_security_config" | + | android:networkSecurityConfig="@xml/network_security_config"> |
− | + | ||
</application> | </application> | ||
参考:https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted | 参考:https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted |
2019年5月16日 (木) 13:05時点における最新版
java.io.IOException: Cleartext HTTP traffic to example.com not permittedエラーが出る
Android8(compileSdkVersion 27)から必要
res/xml/network_security_config.xml
<?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">example.com</domain> </domain-config> </network-security-config>
AndroidManifest.xml
<application android:networkSecurityConfig="@xml/network_security_config"> </application>
参考:https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted