기존에 아이오닉3로 안드로이드 프로젝트를 생성해 앱을 만들었다.
로그인 기능이 있어서 테스트용 기기(삼성 갤럭시 노트5(android7 버전)에서는 잘 작동하다가
최신 기기 삼성 갤럭시 노트9(android 10) , 삼성 갤럭시 노트10(android 10), 삼성 갤럭시 s10(android 9) 에서 로그인이 안되는 현상이 발생하였다.
아이오닉 프로젝트가 자주 말썽을 부려서 아이오닉 문제인 줄 알았지만 안드로이드 버전이 올라가면서 정책이 바뀌어서 발생한 문제이다.
HTTP 통신 쪽 오류이다.
-발생원인
안드로이드 네트워크 보안구성에 따르면 Android9 (API 28) 부터는 일반 텍스트 지원이 사용 중지되었다고 한다.
자세한 내용은 아래 링크를 참고하자
https://developer.android.com/training/articles/security-config?hl=ko
-에러 로그
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
-해결 방법
1.안드로이드 <manifest.xml> 파일에 아래와 같이 추가
manifest.xml
-----
<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/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">
<provider
-----
2. 안드로이드 <xml파일 만들기>
res를 클릭 -> 하위 디렉토리 xml 우클릭 -> new -> xml resource file 클릭
파일 이름은 위의 manifest 파일에 선언했던 network_security_config 로 선언
xml 파일이 생성되면 아래의 소스코드를 추가한다.
network_security_config.xml
----
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<!--Set application-wide security config using base-config tag.-->
<base-config cleartextTrafficPermitted="true"/>
</network-security-config>
----
위의 작업을 완료하면 HTTP 통신이 정상적으로 작동한다.
Ionic4 데이터 업데이트 표시 적용 안됨 문제 (0) | 2020.04.03 |
---|